linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch] mm, migrate: increment fail count on ENOMEM
@ 2016-05-19 22:11 David Rientjes
  2016-05-20 13:06 ` Michal Hocko
  0 siblings, 1 reply; 7+ messages in thread
From: David Rientjes @ 2016-05-19 22:11 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Vlastimil Babka, Mel Gorman, linux-mm, linux-kernel

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.

Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/migrate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/migrate.c b/mm/migrate.c
--- 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++;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-05-24  6:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-19 22:11 [patch] mm, migrate: increment fail count on ENOMEM David Rientjes
2016-05-20 13:06 ` Michal Hocko
2016-05-20 13:19   ` Vlastimil Babka
2016-05-20 13:31     ` Michal Hocko
2016-05-23 22:02       ` Andrew Morton
2016-05-23 23:32         ` Hugh Dickins
2016-05-24  6:17           ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox