From 6c81c9bb0979c101c112e8ccd45880e08bfdb945 Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Tue, 24 Oct 2017 22:07:18 +0800 Subject: [PATCH] osd/PrimaryLogPG: add condition "is_chunky_scrub_active" to check object in chunky_scrub. Avoid every time call scrubber.write_block_by_scrub. Most time scrubber is inactive. And compare to write_block_by_scrub, is_chunky_scrub_active is light. Signed-off-by: Jianpeng Ma --- src/osd/PrimaryLogPG.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 731f135fbb7..ca77a134332 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -2026,7 +2026,7 @@ void PrimaryLogPG::do_op(OpRequestRef& op) return; } - if (write_ordered && + if (write_ordered && scrubber.is_chunky_scrub_active() && scrubber.write_blocked_by_scrub(head)) { dout(20) << __func__ << ": waiting for scrub" << dendl; waiting_for_scrub.push_back(op); -- 2.39.5