Currently the VM decides to start doing background writeback of pages if 10% of the systems pages are dirty, and starts doing synchronous writeback of pages if 40% are dirty. This is great for smaller memory systems, but in larger memory systems (>2GB or so), a process can dirty ALL of lowmem (ZONE_NORMAL, 896MB) without hitting the 40% dirty page ratio needed to force the process to do writeback. For this and other reasons, it'd be nice to have a zone aware dirty page balancer. That is precisely what these 2 patches try to achieve. Patch 2/2 - numafy_balance_dirty_pages.patch: This patch does the following things: 1) Modify balance_dirty_pages_ratelimited() to take a pointer to a struct page. Use this to determine which zone is being dirtied. 2) Change balance_dirty_pages() to balance_dirty_pages_zone(), which now takes a reference to a struct zone to (potentially) balance, rather than balancing the whole system. 3) Finally, create get_dirty_limits_zone(), which takes a reference to a struct zone and returns the dirty limits for that specific zone. The old behavior of get_dirty_limits() is still available by passing a NULL pointer to get_dirty_limits_zone() (background_writeout() uses this). Comments/criticism requested! :) Cheers! -Matt