[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().