lkml.org 
[lkml]   [2010]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 24/47] writeback: increase pause time on concurrent dirtiers
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@fromorbit.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
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.



\
 
 \ /
  Last update: 2010-12-13 08:01    [W:0.120 / U:23.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site