aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorRik van Riel <riel@redhat.com>2005-01-07 21:37:59 -0800
committerLinus Torvalds <torvalds@evo.osdl.org>2005-01-07 21:37:59 -0800
commit93f6c1554312d0be19419f5445cd935231b0293c (patch)
tree51f2f75a922390b9080d811b8fb372051be9dacf /mm
parent157e5929111fbd29ec1731d4cf4787bb7200091b (diff)
downloadhistory-93f6c1554312d0be19419f5445cd935231b0293c.tar.gz
[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: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/vmscan.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 1062a30258a956..402ca278f1efb4 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -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))