diff options
author | David Rientjes <[email protected]> | 2016-05-20 16:59:05 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2016-05-20 17:58:30 -0700 |
commit | dfef2ef4027b1304149a65dc33794eab65e8a3bf (patch) | |
tree | 171faf89fcb9620cfde7132b21c49ba5392fd420 | |
parent | 6cd9dc3e75078ef646076fa63adfb9b85ced0b66 (diff) |
mm, migrate: increment fail count on ENOMEM
If page migration fails due to -ENOMEM, nr_failed should still be
incremented for proper statistics.
This was encountered recently when all page migration vmstats showed 0,
and inferred that migrate_pages() was never called, although in reality
the first page migration failed because compaction_alloc() failed to
find a migration target.
This patch increments nr_failed so the vmstat is properly accounted on
ENOMEM.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: David Rientjes <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Mel Gorman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | mm/migrate.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index 53ab6398e7a2..9baf41c877ff 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1171,6 +1171,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, switch(rc) { case -ENOMEM: + nr_failed++; goto out; case -EAGAIN: retry++; |