]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
WBThrottle: fix incorrect throttle 6713/head
authorZhang Huan <zhanghuan@ict.ac.cn>
Thu, 19 Nov 2015 03:34:35 +0000 (11:34 +0800)
committerZhang Huan <zhanghuan@ict.ac.cn>
Wed, 25 Nov 2015 09:01:35 +0000 (17:01 +0800)
This bug is introduced in commit 573d2cc, that throttle()
incorrectly use the "start flusher" throttle value to block new
write requests.

On a test environment of 2 storage nodes with 7 HDD each, the
overall write performance measured by iozone is doubled with this
patch (boosted from 160MB/s to 300MB/s).

Signed-off-by: Zhang Huan <zhanghuan@ict.ac.cn>
src/os/WBThrottle.cc
src/os/WBThrottle.h

index af3a88893f86a068f066bbb219b2eb33838877b6..04c6922dfa1eacdbeec7f4699a906279a8ca152f 100644 (file)
@@ -262,7 +262,6 @@ void WBThrottle::clear_object(const ghobject_t &hoid)
 void WBThrottle::throttle()
 {
   Mutex::Locker l(lock);
-  while (!stopping && beyond_limit()) {
+  while (!stopping && need_flush())
     cond.Wait(lock);
-  }
 }
index d951943a0cef496e95cd30b27e0ddff373dee3f7..3ed5f21e89aed966277506d9ca3e19df53000b8f 100644 (file)
@@ -137,6 +137,14 @@ private:
     else
       return true;
   }
+  bool need_flush() const {
+    if (cur_ios < io_limits.second &&
+       pending_wbs.size() < fd_limits.second &&
+       cur_size < size_limits.second)
+      return false;
+    else
+      return true;
+  }
 
 public:
   WBThrottle(CephContext *cct);