diff options
author | Hugh Dickins <hughd@google.com> | 2015-02-12 18:00:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-12 21:54:11 -0500 |
commit | ff59909a077b3c51c168cb658601c6b63136a347 (patch) | |
tree | fdd8e3279f54c3458789592306b93bcb637cef8e /mm/compaction.c | |
parent | 9ab3b598d2dfbdb0153ffa7e4b1456bbff59a25d (diff) |
mm: fix negative nr_isolated counts
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>
Cc: <stable@vger.kernel.org> [3.18+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/compaction.c')
-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 782772df62c8..d50d6de6f1b6 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -1103,8 +1103,10 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone, | |||
1103 | low_pfn = isolate_migratepages_block(cc, low_pfn, end_pfn, | 1103 | low_pfn = isolate_migratepages_block(cc, low_pfn, end_pfn, |
1104 | isolate_mode); | 1104 | isolate_mode); |
1105 | 1105 | ||
1106 | if (!low_pfn || cc->contended) | 1106 | if (!low_pfn || cc->contended) { |
1107 | acct_isolated(zone, cc); | ||
1107 | return ISOLATE_ABORT; | 1108 | return ISOLATE_ABORT; |
1109 | } | ||
1108 | 1110 | ||
1109 | /* | 1111 | /* |
1110 | * Either we isolated something and proceed with migration. Or | 1112 | * Either we isolated something and proceed with migration. Or |