From b6de4ab5404a2a7b62a4e200cf459860e58fd8a0 Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Tue, 6 Aug 2019 19:48:03 +0800 Subject: [PATCH] os/bluestore: reduce one lock for deferred_aggressive > 0. Signed-off-by: Jianpeng Ma --- src/os/bluestore/BlueStore.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index dd4e1106c28..e79ad0b1bee 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(); } } } -- 2.39.5