]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
writeback: set max_pause to lowest value on zero bdi_dirty
authorWu Fengguang <fengguang.wu@intel.com>
Sat, 3 Dec 2011 00:21:51 +0000 (18:21 -0600)
committerWu Fengguang <fengguang.wu@intel.com>
Mon, 5 Dec 2011 06:06:29 +0000 (14:06 +0800)
Some trace shows lots of bdi_dirty=0 lines where it's actually some
small value if w/o the accounting errors in the per-cpu bdi stats.

In this case the max pause time should really be set to the smallest
(non-zero) value to avoid IO queue underrun and improve throughput.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
mm/page-writeback.c

index 17403e3a7c89f03ba484db91c0673565398ce982..50f08241f9815668d73b1adfcd5c9585f11bbc15 100644 (file)
@@ -989,8 +989,7 @@ static unsigned long bdi_max_pause(struct backing_dev_info *bdi,
         *
         * 8 serves as the safety ratio.
         */
-       if (bdi_dirty)
-               t = min(t, bdi_dirty * HZ / (8 * bw + 1));
+       t = min(t, bdi_dirty * HZ / (8 * bw + 1));
 
        /*
         * The pause time will be settled within range (max_pause/4, max_pause).