From: Henry Chang Date: Thu, 23 Apr 2015 02:38:27 +0000 (+0800) Subject: Throttle: reset max only if max changed X-Git-Tag: v9.0.1~81^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4444%2Fhead;p=ceph.git Throttle: reset max only if max changed Save some CPU cycles. Signed-off-by: Henry Chang --- diff --git a/src/common/Throttle.cc b/src/common/Throttle.cc index f0dd91d4db9e..ce7666904e17 100644 --- a/src/common/Throttle.cc +++ b/src/common/Throttle.cc @@ -80,6 +80,8 @@ Throttle::~Throttle() void Throttle::_reset_max(int64_t m) { assert(lock.is_locked()); + if ((int64_t)max.read() == m) + return; if (!cond.empty()) cond.front()->SignalOne(); if (logger)