Commit 93f6c155 authored by Rik van Riel's avatar Rik van Riel Committed by Linus Torvalds

[PATCH] vmscan: count writeback pages in nr_scanned

OOM kills have been observed with 70% of the pages in lowmem being in the
writeback state.  If we count those pages in sc->nr_scanned, the VM should
throttle and wait for IO completion, instead of OOM killing.

(akpm: this is how the code was designed to work - we broke it six months
ago).
Signed-off-by: default avatarRik van Riel <riel@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 157e5929
......@@ -369,14 +369,14 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc)
BUG_ON(PageActive(page));
if (PageWriteback(page))
goto keep_locked;
sc->nr_scanned++;
/* Double the slab pressure for mapped and swapcache pages */
if (page_mapped(page) || PageSwapCache(page))
sc->nr_scanned++;
if (PageWriteback(page))
goto keep_locked;
referenced = page_referenced(page, 1, sc->priority <= 0);
/* In active use or really unfreeable? Activate it. */
if (referenced && page_mapping_inuse(page))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment