[PATCH] Always Signal() the first Cond when changing the maximum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 Removes a test by which the waiting queue is only
 Signal()ed if the new maximum is lower than the current
 maximum.  There is no evidence of a use case where such a
 restriction would be useful. In addition waking up a thread
 when the maximum increases gives it a chance to immediately
 continue the suspended process instead of waiting for the
 next put().  For additional context see the discussion at
 http://marc.info/?t=135868938300001&r=1&w=4

Signed-off-by: Loic Dachary <loic@xxxxxxxxxxx>
---
 src/common/Throttle.cc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/Throttle.cc b/src/common/Throttle.cc
index 844263a..82ffe7a 100644
--- a/src/common/Throttle.cc
+++ b/src/common/Throttle.cc
@@ -65,7 +65,7 @@ Throttle::~Throttle()
 void Throttle::_reset_max(int64_t m)
 {
   assert(lock.is_locked());
-  if (m < ((int64_t)max.read()) && !cond.empty())
+  if (!cond.empty())
     cond.front()->SignalOne();
   logger->set(l_throttle_max, m);
   max.set((size_t)m);
-- 
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux