diff options
author | Mel Gorman <mgorman@suse.de> | 2013-07-08 19:00:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-09 13:33:23 -0400 |
commit | 5a1c9cbc1550f93335d7c03eb6c271e642deff04 (patch) | |
tree | fcb1a125a410a68807aa02e317d0717e65d7abd4 /mm/vmscan.c | |
parent | 7e9f5eb03d3762ec89dda1888c774ae7b4040af7 (diff) |
mm: vmscan: do not continue scanning if reclaim was aborted for compaction
Direct reclaim is not aborting to allow compaction to go ahead properly.
do_try_to_free_pages is told to abort reclaim which is happily ignores
and instead increases priority instead until it reaches 0 and starts
shrinking file/anon equally. This patch corrects the situation by
aborting reclaim when requested instead of raising priority.
Signed-off-by: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.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.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 99b3ac7771ad..2385663ae5e5 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -2361,8 +2361,10 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | |||
2361 | aborted_reclaim = shrink_zones(zonelist, sc); | 2361 | aborted_reclaim = shrink_zones(zonelist, sc); |
2362 | 2362 | ||
2363 | /* | 2363 | /* |
2364 | * Don't shrink slabs when reclaiming memory from | 2364 | * Don't shrink slabs when reclaiming memory from over limit |
2365 | * over limit cgroups | 2365 | * cgroups but do shrink slab at least once when aborting |
2366 | * reclaim for compaction to avoid unevenly scanning file/anon | ||
2367 | * LRU pages over slab pages. | ||
2366 | */ | 2368 | */ |
2367 | if (global_reclaim(sc)) { | 2369 | if (global_reclaim(sc)) { |
2368 | unsigned long lru_pages = 0; | 2370 | unsigned long lru_pages = 0; |
@@ -2404,7 +2406,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | |||
2404 | WB_REASON_TRY_TO_FREE_PAGES); | 2406 | WB_REASON_TRY_TO_FREE_PAGES); |
2405 | sc->may_writepage = 1; | 2407 | sc->may_writepage = 1; |
2406 | } | 2408 | } |
2407 | } while (--sc->priority >= 0); | 2409 | } while (--sc->priority >= 0 && !aborted_reclaim); |
2408 | 2410 | ||
2409 | out: | 2411 | out: |
2410 | delayacct_freepages_end(); | 2412 | delayacct_freepages_end(); |