]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: narrow qlock in _deferred_aio_finish
authorJianpeng Ma <jianpeng.ma@intel.com>
Tue, 12 Jun 2018 15:40:38 +0000 (23:40 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Tue, 12 Jun 2018 15:40:38 +0000 (23:40 +0800)
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/os/bluestore/BlueStore.cc

index 1a9c9895e644f907cf6d99592b0438655567838e..b9a8ddd6b54bd7e494910021b2934590104fac2a 100644 (file)
@@ -9445,14 +9445,16 @@ void BlueStore::_deferred_aio_finish(OpSequencer *osr)
 
   {
     uint64_t costs = 0;
-    std::lock_guard<std::mutex> l2(osr->qlock);
-    for (auto& i : b->txcs) {
-      TransContext *txc = &i;
-      txc->log_state_latency(logger, l_bluestore_state_deferred_aio_wait_lat);
-      txc->state = TransContext::STATE_DEFERRED_CLEANUP;
-      costs += txc->cost;
+    {
+      std::lock_guard<std::mutex> l2(osr->qlock);
+      for (auto& i : b->txcs) {
+       TransContext *txc = &i;
+       txc->log_state_latency(logger, l_bluestore_state_deferred_aio_wait_lat);
+       txc->state = TransContext::STATE_DEFERRED_CLEANUP;
+       costs += txc->cost;
+      }
+      osr->qcond.notify_all();
     }
-    osr->qcond.notify_all();
     throttle_deferred_bytes.put(costs);
     std::lock_guard<std::mutex> l(kv_lock);
     deferred_done_queue.emplace_back(b);