From: David Rientjes Date: Fri, 20 May 2016 23:59:05 +0000 (-0700) Subject: mm, migrate: increment fail count on ENOMEM X-Git-Tag: v4.9.8~2047^2~107 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dfef2ef4027b1304149a65dc33794eab65e8a3bf;p=platform%2Fkernel%2Flinux-rpi3.git 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 Cc: Vlastimil Babka Cc: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/migrate.c b/mm/migrate.c index 53ab639..9baf41c 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++;