]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/newstore: debug io_submit EAGAIN
authorSage Weil <sage@redhat.com>
Tue, 28 Jul 2015 17:24:00 +0000 (13:24 -0400)
committerSage Weil <sage@redhat.com>
Tue, 1 Sep 2015 17:39:40 +0000 (13:39 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/fs/FS.h
src/os/newstore/NewStore.cc

index 51c6363f13fcd9dabe6f1eadedc6ed24e2df8001..4b52732422677a7ca1fcf537f451d7db167d08be 100644 (file)
@@ -71,7 +71,7 @@ public:
     int max_iodepth;
     io_context_t ctx;
 
-    aio_queue_t(unsigned max_iodepth = 8)
+    aio_queue_t(unsigned max_iodepth)
       : max_iodepth(max_iodepth),
        ctx(0) {
     }
@@ -91,7 +91,7 @@ public:
       }
     }
 
-    int submit(aio_t &aio) {
+    int submit(aio_t &aio, int *retries) {
       int attempts = 10;
       iocb *piocb = &aio.iocb;
       do {
@@ -99,10 +99,12 @@ public:
        if (r < 0) {
          if (r == -EAGAIN && attempts-- > 0) {
            usleep(500);
+           (*retries)++;
            continue;
          }
          return r;
        }
+       assert(r == 1);
       } while (false);
       return 0;
     }
index 1367e6e5bc1a57b8a089579aa5f0c5311c2e13fa..6d75a3459b4cb98d41487115dd6bd882742e93a9 100644 (file)
@@ -2624,7 +2624,8 @@ int NewStore::queue_transactions(
 void NewStore::_txc_aio_submit(TransContext *txc)
 {
   int num = txc->aios.size();
-  dout(10) << __func__ << " submitting " << num << " aios" << dendl;
+  dout(10) << __func__ << " txc " << txc << " submitting " << num << dendl;
+  assert(num > 0);
   txc->num_aio.set(num);
   for (list<FS::aio_t>::iterator p = txc->aios.begin();
        p != txc->aios.end();
@@ -2636,7 +2637,10 @@ void NewStore::_txc_aio_submit(TransContext *txc)
               << " len " << q->iov_len << dendl;
     dout(30) << " fd " << aio.fd << " offset " << lseek64(aio.fd, 0, SEEK_CUR)
             << dendl;
-    int r = aio_queue.submit(*p);
+    int retries = 0;
+    int r = aio_queue.submit(*p, &retries);
+    if (retries)
+      derr << __func__ << " retries " << retries << dendl;
     if (r) {
       derr << " aio submit got " << cpp_strerror(r) << dendl;
       assert(r == 0);