diff options
author | Hugh Dickins <hughd@google.com> | 2015-02-12 15:00:28 -0800 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-03-14 15:37:16 -0400 |
commit | b7c386cf63c54ae1d569e0708f6fb6b36f58c377 (patch) | |
tree | 9bf4c1efe2e90703b1c84984b4aab90d3c8c41e4 | |
parent | 463fb5a2cc7013f50763ee2322fa724553150842 (diff) | |
download | lwn-b7c386cf63c54ae1d569e0708f6fb6b36f58c377.tar.gz lwn-b7c386cf63c54ae1d569e0708f6fb6b36f58c377.zip |
mm: fix negative nr_isolated counts
commit ff59909a077b3c51c168cb658601c6b63136a347 upstream.
The vmstat interfaces are good at hiding negative counts (at least when
CONFIG_SMP); but if you peer behind the curtain, you find that
nr_isolated_anon and nr_isolated_file soon go negative, and grow ever
more negative: so they can absorb larger and larger numbers of isolated
pages, yet still appear to be zero.
I'm happy to avoid a congestion_wait() when too_many_isolated() myself;
but I guess it's there for a good reason, in which case we ought to get
too_many_isolated() working again.
The imbalance comes from isolate_migratepages()'s ISOLATE_ABORT case:
putback_movable_pages() decrements the NR_ISOLATED counts, but we forgot
to call acct_isolated() to increment them.
It is possible that the bug whcih this patch fixes could cause OOM kills
when the system still has a lot of reclaimable page cache.
Fixes: edc2ca612496 ("mm, compaction: move pageblock checks up from isolate_migratepages_range()")
Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r-- | mm/compaction.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/compaction.c b/mm/compaction.c index 71e613e12747..b47f08e159d4 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1027,8 +1027,10 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone, low_pfn = isolate_migratepages_block(cc, low_pfn, end_pfn, isolate_mode); - if (!low_pfn || cc->contended) + if (!low_pfn || cc->contended) { + acct_isolated(zone, cc); return ISOLATE_ABORT; + } /* * Either we isolated something and proceed with migration. Or |