[patch 5/7] mm: throttle writeout with cpuset awareness

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Rientjes
Date: Tuesday, October 28, 2008 - 9:08 am

From: Christoph Lameter <cl@linux-foundation.org>

This bases the VM throttling from the reclaim path on the dirty ratio of
the cpuset.  Note that a cpuset is only effective if shrink_zone is called
from direct reclaim.

kswapd has a cpuset context that includes the whole machine.  VM
throttling will only work during synchrononous reclaim and not from
kswapd.

Signed-off-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Menage <menage@google.com>
Cc: Derek Fults <dfults@sgi.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 include/linux/writeback.h |    2 +-
 mm/page-writeback.c       |    4 ++--
 mm/vmscan.c               |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/writeback.h b/include/linux/writeback.h
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -114,7 +114,7 @@ static inline void inode_sync_wait(struct inode *inode)
 int wakeup_pdflush(long nr_pages, nodemask_t *nodes);
 void laptop_io_completion(void);
 void laptop_sync_completion(void);
-void throttle_vm_writeout(gfp_t gfp_mask);
+void throttle_vm_writeout(nodemask_t *nodes, gfp_t gfp_mask);
 
 /* These are exported to sysctl. */
 extern int dirty_background_ratio;
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -600,12 +600,12 @@ void balance_dirty_pages_ratelimited_nr(struct address_space *mapping,
 }
 EXPORT_SYMBOL(balance_dirty_pages_ratelimited_nr);
 
-void throttle_vm_writeout(gfp_t gfp_mask)
+void throttle_vm_writeout(nodemask_t *nodes, gfp_t gfp_mask)
 {
 	struct dirty_limits dl;
 
         for ( ; ; ) {
-		get_dirty_limits(&dl, NULL, &node_states[N_HIGH_MEMORY]);
+		get_dirty_limits(&dl, NULL, nodes);
 
 		/*
 		 * Boost the allowable dirty threshold a bit for page
diff --git a/mm/vmscan.c b/mm/vmscan.c
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1466,7 +1466,7 @@ static unsigned long shrink_zone(int priority, struct zone *zone,
 	else if (!scan_global_lru(sc))
 		shrink_active_list(SWAP_CLUSTER_MAX, zone, sc, priority, 0);
 
-	throttle_vm_writeout(sc->gfp_mask);
+	throttle_vm_writeout(&cpuset_current_mems_allowed, sc->gfp_mask);
 	return nr_reclaimed;
 }
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 1/7] cpusets: add dirty map to struct address_space, David Rientjes, (Tue Oct 28, 9:08 am)
[patch 4/7] mm: cpuset aware reclaim writeout, David Rientjes, (Tue Oct 28, 9:08 am)
[patch 5/7] mm: throttle writeout with cpuset awareness, David Rientjes, (Tue Oct 28, 9:08 am)
[patch 6/7] cpusets: per cpuset dirty ratios, David Rientjes, (Tue Oct 28, 9:08 am)
Re: [patch 6/7] cpusets: per cpuset dirty ratios, Paul Menage, (Wed Oct 29, 11:59 pm)
Re: [patch 6/7] cpusets: per cpuset dirty ratios, Peter Zijlstra, (Thu Oct 30, 1:44 am)
Re: [patch 6/7] cpusets: per cpuset dirty ratios, David Rientjes, (Thu Oct 30, 1:48 am)
Re: [patch 6/7] cpusets: per cpuset dirty ratios, David Rientjes, (Thu Oct 30, 2:03 am)
Re: [patch 6/7] cpusets: per cpuset dirty ratios, Peter Zijlstra, (Thu Oct 30, 2:34 am)
Re: [patch 6/7] cpusets: per cpuset dirty ratios, David Rientjes, (Thu Oct 30, 3:02 am)
Re: [patch 6/7] cpusets: per cpuset dirty ratios, Christoph Lameter, (Thu Oct 30, 8:28 am)
Re: [patch 7/7] cpusets: update documentation for writebac ..., Christoph Lameter, (Thu Oct 30, 9:06 am)