From bdde3a8bb5f627cabc6f7aab81a61be4764e54f1 Mon Sep 17 00:00:00 2001 From: Jianpeng Ma Date: Wed, 1 Apr 2020 15:47:46 +0800 Subject: [PATCH] common/Throttle: Don't lock for atomic type update. Signed-off-by: Jianpeng Ma --- src/common/Throttle.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/common/Throttle.cc b/src/common/Throttle.cc index e483e154c9e..9815493cea7 100644 --- a/src/common/Throttle.cc +++ b/src/common/Throttle.cc @@ -141,10 +141,7 @@ int64_t Throttle::take(int64_t c) } ceph_assert(c >= 0); ldout(cct, 10) << "take " << c << dendl; - { - std::lock_guard l(lock); - count += c; - } + count += c; if (logger) { logger->inc(l_throttle_take); logger->inc(l_throttle_take_sum, c); -- 2.39.5