aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorMinchan Kim <minchan@kernel.org>2012-01-10 18:08:18 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-10 19:30:45 -0500
commit86cfd3a45042ab242d47f3935a02811a402beab6 (patch)
treebd189c05dc3176f2193192ecea01f6b3a1ff8c71 /mm/vmscan.c
parent799f933a82d878d7f15215473c5561ce984ada75 (diff)
mm/vmscan.c: consider swap space when deciding whether to continue reclaim
It's pointless to continue reclaiming when we have no swap space and lots of anon pages in the inactive list. Without this patch, it is possible when swap is disabled to continue trying to reclaim when there are only anonymous pages in the system even though that will not make any progress. Signed-off-by: Minchan Kim <minchan@kernel.org> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Acked-by: Mel Gorman <mgorman@suse.de> Reviewed-by: Rik van Riel <riel@redhat.com> Cc: Johannes Weiner <jweiner@redhat.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 974162c80edb..b935e6f0d695 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2000,8 +2000,9 @@ static inline bool should_continue_reclaim(struct zone *zone,
2000 * inactive lists are large enough, continue reclaiming 2000 * inactive lists are large enough, continue reclaiming
2001 */ 2001 */
2002 pages_for_compaction = (2UL << sc->order); 2002 pages_for_compaction = (2UL << sc->order);
2003 inactive_lru_pages = zone_nr_lru_pages(zone, sc, LRU_INACTIVE_ANON) + 2003 inactive_lru_pages = zone_nr_lru_pages(zone, sc, LRU_INACTIVE_FILE);
2004 zone_nr_lru_pages(zone, sc, LRU_INACTIVE_FILE); 2004 if (nr_swap_pages > 0)
2005 inactive_lru_pages += zone_nr_lru_pages(zone, sc, LRU_INACTIVE_ANON);
2005 if (sc->nr_reclaimed < pages_for_compaction && 2006 if (sc->nr_reclaimed < pages_for_compaction &&
2006 inactive_lru_pages > pages_for_compaction) 2007 inactive_lru_pages > pages_for_compaction)
2007 return true; 2008 return true;