]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: when requeueing QOS throttled request queue it back 28120/head
authorMykola Golub <mgolub@suse.com>
Fri, 15 Mar 2019 15:17:42 +0000 (15:17 +0000)
committerJason Dillaman <dillaman@redhat.com>
Wed, 15 May 2019 18:13:27 +0000 (14:13 -0400)
to preserve order of throttled requests, which is important for flush.

Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit 633a167ff04b1f9af6acde41f279c525b3ce87f3)

src/librbd/io/ImageRequestWQ.cc
src/test/librbd/io/test_mock_ImageRequestWQ.cc

index a5101aa04843899c0eada0227d1838755d36ab59..70e6aae9c91c389fc7c90b69fb2a484642d5a21b 100644 (file)
@@ -661,7 +661,7 @@ void ImageRequestWQ<I>::handle_throttle_ready(int r, ImageDispatchSpec<I> *item,
   ceph_assert(m_io_throttled.load() > 0);
   item->set_throttled(flag);
   if (item->were_all_throttled()) {
-    this->requeue_front(item);
+    this->requeue_back(item);
     --m_io_throttled;
     this->signal();
   }
index 352b888d3996bd37057750f83bc817f97361405b..50daa83c777bc506e9a58127d39a69939d0f9863 100644 (file)
@@ -105,6 +105,7 @@ struct ThreadPool::PointerWQ<librbd::io::ImageDispatchSpec<librbd::MockTestImage
 
   MOCK_METHOD0(front, ImageDispatchSpec*());
   MOCK_METHOD1(requeue_front, void(ImageDispatchSpec*));
+  MOCK_METHOD1(requeue_back, void(ImageDispatchSpec*));
 
   MOCK_METHOD0(dequeue, void*());
   MOCK_METHOD1(queue, void(ImageDispatchSpec*));
@@ -170,8 +171,8 @@ struct TestMockIoImageRequestWQ : public TestMockFixture {
     EXPECT_CALL(image_request_wq, queue(_));
   }
 
-  void expect_requeue_front(MockImageRequestWQ &image_request_wq) {
-    EXPECT_CALL(image_request_wq, requeue_front(_));
+  void expect_requeue_back(MockImageRequestWQ &image_request_wq) {
+    EXPECT_CALL(image_request_wq, requeue_back(_));
   }
 
   void expect_front(MockImageRequestWQ &image_request_wq,
@@ -425,7 +426,7 @@ TEST_F(TestMockIoImageRequestWQ, BPSQosNoBurst) {
   expect_tokens_requested(mock_queued_image_request, 2, true);
   expect_dequeue(mock_image_request_wq, &mock_queued_image_request);
   expect_all_throttled(mock_queued_image_request, true);
-  expect_requeue_front(mock_image_request_wq);
+  expect_requeue_back(mock_image_request_wq);
   expect_signal(mock_image_request_wq);
   ASSERT_TRUE(mock_image_request_wq.invoke_dequeue() == nullptr);
 }
@@ -449,7 +450,7 @@ TEST_F(TestMockIoImageRequestWQ, BPSQosWithBurst) {
   expect_tokens_requested(mock_queued_image_request, 2, true);
   expect_dequeue(mock_image_request_wq, &mock_queued_image_request);
   expect_all_throttled(mock_queued_image_request, true);
-  expect_requeue_front(mock_image_request_wq);
+  expect_requeue_back(mock_image_request_wq);
   expect_signal(mock_image_request_wq);
   ASSERT_TRUE(mock_image_request_wq.invoke_dequeue() == nullptr);
 }