Index: linux-2.6.20-rc4/include/linux/writeback.h =================================================================== --- linux-2.6.20-rc4.orig/include/linux/writeback.h 2007-01-09 07:19:19.000000000 -0600 +++ linux-2.6.20-rc4/include/linux/writeback.h 2007-01-09 07:43:24.282223620 -0600 @@ -85,7 +85,6 @@ static inline void wait_on_inode(struct int wakeup_pdflush(long nr_pages, nodemask_t *nodes); void laptop_io_completion(void); void laptop_sync_completion(void); -void throttle_vm_writeout(void); /* These are exported to sysctl. */ extern int dirty_background_ratio; Index: linux-2.6.20-rc4/mm/page-writeback.c =================================================================== --- linux-2.6.20-rc4.orig/mm/page-writeback.c 2007-01-09 07:42:46.000000000 -0600 +++ linux-2.6.20-rc4/mm/page-writeback.c 2007-01-09 07:43:53.318941232 -0600 @@ -349,26 +349,6 @@ void balance_dirty_pages_ratelimited_nr( } EXPORT_SYMBOL(balance_dirty_pages_ratelimited_nr); -void throttle_vm_writeout(void) -{ - struct dirty_limits dl; - - for ( ; ; ) { - get_dirty_limits(&dl, NULL, &node_online_map); - - /* - * Boost the allowable dirty threshold a bit for page - * allocators so they don't get DoS'ed by heavy writers - */ - dl.thresh_dirty += dl.thresh_dirty / 10; /* wheeee... */ - - if (dl.nr_unstable + dl.nr_writeback <= dl.thresh_dirty) - break; - congestion_wait(WRITE, HZ/10); - } -} - - /* * writeback at least _min_pages, and keep writing until the amount of dirty * memory is less than the background threshold, or until we're all clean. Index: linux-2.6.20-rc4/mm/vmscan.c =================================================================== --- linux-2.6.20-rc4.orig/mm/vmscan.c 2007-01-09 07:42:50.000000000 -0600 +++ linux-2.6.20-rc4/mm/vmscan.c 2007-01-09 07:58:58.458521221 -0600 @@ -949,7 +949,26 @@ static unsigned long shrink_zone(int pri } } - throttle_vm_writeout(); + /* + * Throttle writeouts to this zone. + * + * This is similar to the ratio calculation in get_dirty_limits() + * but we are only interested in the dirty ratio for this zone and + * get_dirty_limits only operates on nodes or the system as a whole. + * + * Howeve, we ignore the boundary checks for dirty_ratio here since + * there is not much harm done if the user specifies a too high or + * too low dirty ratio. + */ + if (zone_page_state(zone, NR_UNSTABLE_NFS) + + zone_page_state(zone, NR_WRITEBACK) > + (zone->present_pages * vm_dirty_ratio) / 100 + + /* + * Boost the allowable dirty threshold a bit for page + * allocators so they don't get DoS'ed by heavy writers + */ + (zone->present_pages * vm_dirty_ratio) / 1000) + congestion_wait(WRITE, HZ/10); atomic_dec(&zone->reclaim_in_progress); return nr_reclaimed;