Direct reclaim: cpuset aware writeout During direct reclaim we traverse down a zonelist and are carefully checking each zone if its a member of the active cpuset. But then we call pdflush without enforcing the same restriction. In a larger system this has the effect of pages being dirtied in the cpuset and then either A. No writeout occurs because global dirty limits have not been reached or B. Writeout starts randomly for any dirty inode in the system. Pdflush may just write out data for nodes in another cpuset and miss doing proper dirty handling for the current cpuset. Fix that by requiring pdflush to only flush inodes that have pages on a node in the cpuset. Dave: This is an inode based writeout that will avoid the single page writeout you are concerned about. Signed-off-by: Christoph Lameter Index: linux-2.6.20-rc4/mm/vmscan.c =================================================================== --- linux-2.6.20-rc4.orig/mm/vmscan.c 2007-01-08 18:11:16.867231662 -0600 +++ linux-2.6.20-rc4/mm/vmscan.c 2007-01-08 18:11:17.772586575 -0600 @@ -1065,7 +1065,8 @@ unsigned long try_to_free_pages(struct z */ if (total_scanned > sc.swap_cluster_max + sc.swap_cluster_max / 2) { - wakeup_pdflush(laptop_mode ? 0 : total_scanned, NULL); + wakeup_pdflush(laptop_mode ? 0 : total_scanned, + &cpuset_current_mems_allowed); sc.may_writepage = 1; }