-
Andrew Morton authored
The current writer throttling in balance_dirty_pages() assumes that the writer will be effectively throttled on request queues. That works fine when the amount of data which can be placed into a queue is "much less than" total memory. But if the machine has a small amount of memory, or many disks, or has large request queues, or large requests, it can go wrong. For example, with mem=96m and dirty_async_ratio=15, we want to be able to clamp dirty+writeback memory at 15 megabytes. But it doesn't work, because a single SCSI request queue can hold 40 megs or more. The heavy writer keeps on dirtying memory until that queue fills up. So add a test for that - if we did some writeback, and we're *still* over the dirty+writeback threshold then make the caller take an explicit nap on some writes terminating. And keep on doing that until the dirty+writeback memory subsides.
3a1bfe87