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 restrictions. In a larger system this may have the effect of a massive amount of pages being dirtied and then either A. No writeout occurs because global dirty limits have not been reached or B. Writeout starts randomly for some 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. In both cases dirty pages in the zones of interest may not be affected and writeout may not occur as necessary. Fix that by restricting pdflush to the active cpuset. Writeout will occur from direct reclaim the same way as without a cpuset. Signed-off-by: Christoph Lameter Index: linux-2.6.21-rc4-mm1/mm/vmscan.c =================================================================== --- linux-2.6.21-rc4-mm1.orig/mm/vmscan.c 2007-03-22 15:08:19.000000000 -0700 +++ linux-2.6.21-rc4-mm1/mm/vmscan.c 2007-03-22 15:08:24.000000000 -0700 @@ -1174,7 +1174,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; }