[PATCH 24/47] writeback: increase pause time on concurrent dirtiers

From: Wu Fengguang
Date: Mon Dec 13 2010 - 01:57:49 EST


Increase max pause time to 200ms, and make it work for (HZ < 5).

The larger 200ms will help reduce overheads in server workloads with
lots of concurrent dirtier tasks.

CC: Dave Chinner <david@xxxxxxxxxxxxx>
Signed-off-by: Wu Fengguang <fengguang.wu@xxxxxxxxx>
---
mm/page-writeback.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

--- linux-next.orig/mm/page-writeback.c 2010-12-09 11:52:05.000000000 +0800
+++ linux-next/mm/page-writeback.c 2010-12-09 11:54:05.000000000 +0800
@@ -36,6 +36,11 @@
#include <linux/pagevec.h>
#include <trace/events/writeback.h>

+/*
+ * Don't sleep more than 200ms at a time in balance_dirty_pages().
+ */
+#define MAX_PAUSE max(HZ/5, 1)
+
/* The following parameters are exported via /proc/sys/vm */

/*
@@ -660,7 +665,7 @@ static void balance_dirty_pages(struct a
bdi_update_bandwidth(bdi, start_time, bdi_dirty, bdi_thresh);

if (bdi_dirty >= task_thresh) {
- pause = HZ/10;
+ pause = MAX_PAUSE;
goto pause;
}

@@ -679,7 +684,7 @@ static void balance_dirty_pages(struct a
do_div(bw, bdi_thresh / TASK_SOFT_DIRTY_LIMIT + 1);

pause = HZ * pages_dirtied / ((unsigned long)bw + 1);
- pause = clamp_val(pause, 1, HZ/10);
+ pause = clamp_val(pause, 1, MAX_PAUSE);

pause:
trace_balance_dirty_pages(bdi,
@@ -714,7 +719,7 @@ pause:
current->nr_dirtied_pause = ratelimit_pages(bdi);
else if (pause == 1)
current->nr_dirtied_pause += current->nr_dirtied_pause / 32 + 1;
- else if (pause >= HZ/10)
+ else if (pause >= MAX_PAUSE)
/*
* when repeated, writing 1 page per 100ms on slow devices,
* i-(i+2)/4 will be able to reach 1 but never reduce to 0.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/