Commit 5a1c9cbc authored by Mel Gorman's avatar Mel Gorman Committed by Linus Torvalds

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: default avatarMel 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7e9f5eb0
...@@ -2361,8 +2361,10 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, ...@@ -2361,8 +2361,10 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
aborted_reclaim = shrink_zones(zonelist, sc); aborted_reclaim = shrink_zones(zonelist, sc);
/* /*
* Don't shrink slabs when reclaiming memory from * Don't shrink slabs when reclaiming memory from over limit
* over limit cgroups * cgroups but do shrink slab at least once when aborting
* reclaim for compaction to avoid unevenly scanning file/anon
* LRU pages over slab pages.
*/ */
if (global_reclaim(sc)) { if (global_reclaim(sc)) {
unsigned long lru_pages = 0; unsigned long lru_pages = 0;
...@@ -2404,7 +2406,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, ...@@ -2404,7 +2406,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
WB_REASON_TRY_TO_FREE_PAGES); WB_REASON_TRY_TO_FREE_PAGES);
sc->may_writepage = 1; sc->may_writepage = 1;
} }
} while (--sc->priority >= 0); } while (--sc->priority >= 0 && !aborted_reclaim);
out: out:
delayacct_freepages_end(); delayacct_freepages_end();
......
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