Skip to content

Commit dfef2ef

Browse files
rientjestorvalds
authored andcommitted
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/alpine.DEB.2.10.1605191510230.32658@chino.kir.corp.google.com Signed-off-by: David Rientjes <rientjes@google.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 6cd9dc3 commit dfef2ef

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mm/migrate.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,
11711171

11721172
switch(rc) {
11731173
case -ENOMEM:
1174+
nr_failed++;
11741175
goto out;
11751176
case -EAGAIN:
11761177
retry++;

0 commit comments

Comments
 (0)