]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix exceeding the max IO queue depth in KernelDevice. 21407/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 21 Mar 2018 20:31:38 +0000 (21:31 +0100)
committerKefu Chai <kchai@redhat.com>
Fri, 13 Apr 2018 08:04:52 +0000 (16:04 +0800)
Fixes: http://tracker.ceph.com/issues/23246
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
(cherry picked from commit dcb4e23d3eff03350caefd2806b9c0760feaebcd)

src/os/bluestore/aio.cc

index 4996e73452b119a8c9c50085d5c858e71534ece5..256f3db97fd551f2d8a91c8f533835db4b886bb5 100644 (file)
@@ -1,6 +1,7 @@
 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
+#include <algorithm>
 #include "aio.h"
 
 #if defined(HAVE_LIBAIO)
@@ -48,7 +49,7 @@ int aio_queue_t::submit_batch(aio_iter begin, aio_iter end,
   }
   int done = 0;
   while (left > 0) {
-    int r = io_submit(ctx, left, piocb + done);
+    int r = io_submit(ctx, std::min(left, max_iodepth), piocb + done);
     if (r < 0) {
       if (r == -EAGAIN && attempts-- > 0) {
        usleep(delay);
@@ -61,6 +62,8 @@ int aio_queue_t::submit_batch(aio_iter begin, aio_iter end,
     assert(r > 0);
     done += r;
     left -= r;
+    attempts = 16;
+    delay = 125;
   }
   return done;
 }