From: Jianpeng Ma Date: Tue, 6 Aug 2019 11:48:03 +0000 (+0800) Subject: os/bluestore: reduce one lock for deferred_aggressive > 0. X-Git-Tag: v15.1.0~1903^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b6de4ab5404a2a7b62a4e200cf459860e58fd8a0;p=ceph.git os/bluestore: reduce one lock for deferred_aggressive > 0. Signed-off-by: Jianpeng Ma --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index dd4e1106c289..e79ad0b1beea 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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(); } } }