]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: reduce one lock for deferred_aggressive > 0.
authorJianpeng Ma <jianpeng.ma@intel.com>
Tue, 6 Aug 2019 11:48:03 +0000 (19:48 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Wed, 7 Aug 2019 01:58:16 +0000 (09:58 +0800)
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/os/bluestore/BlueStore.cc

index dd4e1106c28924383111946ea0e0259d7af27527..e79ad0b1beea043e7c3b2845516a6dec9807634a 100644 (file)
@@ -11030,17 +11030,17 @@ void BlueStore::_deferred_aio_finish(OpSequencer *osr)
       }
     }
     throttle_deferred_bytes.put(costs);
-    std::lock_guard l(kv_lock);
-    deferred_done_queue.emplace_back(b);
   }
 
-  // in the normal case, do not bother waking up the kv thread; it will
-  // catch us on the next commit anyway.
-  if (deferred_aggressive) {
+  {
     std::lock_guard l(kv_lock);
-    if (!kv_sync_in_progress) {
-      kv_sync_in_progress = true;
-      kv_cond.notify_one();
+    deferred_done_queue.emplace_back(b);
+
+    // in the normal case, do not bother waking up the kv thread; it will
+    // catch us on the next commit anyway.
+    if (deferred_aggressive && !kv_sync_in_progress) {
+       kv_sync_in_progress = true;
+       kv_cond.notify_one();
     }
   }
 }