]> git.hungrycats.org Git - linux/commit
[PATCH] fix possible latency in balance_dirty_pages()
authorAndrew Morton <akpm@digeo.com>
Sat, 8 Mar 2003 11:22:49 +0000 (03:22 -0800)
committerJames Bottomley <jejb@raven.il.steeleye.com>
Sat, 8 Mar 2003 11:22:49 +0000 (03:22 -0800)
commit9655215689729527c501184f5dd1ae8e1e100f99
treee475630aea732f4fd87784f26bb38fd373bae242
parent9a64905a424dfbfab620ada21d1c6036d8bc4055
[PATCH] fix possible latency in balance_dirty_pages()

Tasks which throttle in balance_dirty_pages() will loop until the amount of
dirty memory falls below the configured dirty_ratio.

This exposes the possibility that one task could be stuck in there for
arbitrary periods of time due to page dirtying activity by other tasks.

The patch changes the logic so that tasks will break out of the loop if they
have written enough pages, regardless of the current dirty memory limits.

Here "enough" pages is 1.5x the number of pages which they just dirtied.

If the amount of dirty memory in the machine happens to still exceed
dirty_ratio (say, due to MAP_SHARED activity) then the task will again
throttle after dirtying a single page.  But there is now an upper limit on
the time for which a single task will be captured in balance_dirty_pages().
mm/page-writeback.c