From 3ececd98bc9af3af9f2282ae8afc5832063d13c3 Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Mon, 5 Aug 2019 17:25:25 +0300 Subject: [PATCH] osd: do not check ContextQueue for empty before taking the content. This saves one lock acquisition. And empty() call is useless as move_to checks for emptyness anyway() Signed-off-by: Igor Fedotov --- src/osd/OSD.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 052768b672f..5988c282606 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -10493,7 +10493,7 @@ void OSD::ShardedOpWQ::_process(uint32_t thread_index, heartbeat_handle_d *hb) } list oncommits; - if (is_smallest_thread_index && !sdata->context_queue.empty()) { + if (is_smallest_thread_index) { sdata->context_queue.move_to(oncommits); } -- 2.47.3