]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: release throttle before commit
authorSage Weil <sage@redhat.com>
Mon, 3 Apr 2017 19:46:45 +0000 (15:46 -0400)
committerSage Weil <sage@redhat.com>
Wed, 5 Apr 2017 14:26:56 +0000 (10:26 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index b77f271ba8672b82521fb169b929329acad22ebd..5edb8e347a83fe8bc86612d27bfab4f273949300 100644 (file)
@@ -7497,8 +7497,6 @@ void BlueStore::_txc_committed_kv(TransContext *txc)
   if (!txc->oncommits.empty()) {
     finishers[n]->queue(txc->oncommits);
   }
-  throttle_ops.put(txc->ops);
-  throttle_bytes.put(txc->bytes);
 }
 
 void BlueStore::_txc_finish(TransContext *txc)
@@ -7786,12 +7784,19 @@ void BlueStore::_kv_sync_thread()
          }
        }
       }
-      if (num_aios) {
-       for (auto txc : kv_committing) {
-         if (txc->had_ios) {
-           --txc->osr->txc_with_unstable_io;
-         }
+      for (auto txc : kv_committing) {
+       if (txc->had_ios) {
+         --txc->osr->txc_with_unstable_io;
        }
+
+       // release throttle *before* we commit.  this allows new ops
+       // to be prepared and enter pipeline while we are waiting on
+       // the kv commit sync/flush.  then hopefully on the next
+       // iteration there will already be ops awake.  otherwise, we
+       // end up going to sleep, and then wake up when the very first
+       // transaction is ready for commit.
+       throttle_ops.put(txc->ops);
+       throttle_bytes.put(txc->bytes);
       }
 
       PExtentVector bluefs_gift_extents;