From fbdf9cd38a0801c687ff60b74384e778d43eef6d Mon Sep 17 00:00:00 2001 From: Minchan Kim Date: Tue, 25 May 2021 07:43:44 -0700 Subject: [PATCH] FROMLIST: mm: page_alloc: dump migrate-failed pages only at -EBUSY alloc_contig_dump_pages() aims for helping debugging page migration failure by elevated page refcount compared to expected_count. (for the detail, please look at migrate_page_move_mapping) However, -ENOMEM is just the case that system is under memory pressure state, not relevant with page refcount at all. Thus, the dumping page list is not helpful for the debugging point of view. Link: https://lkml.kernel.org/r/YKa2Wyo9xqIErpfa@google.com Signed-off-by: Minchan Kim Reviewed-by: David Hildenbrand Cc: Suren Baghdasaryan Cc: John Dias Cc: Michal Hocko Signed-off-by: Andrew Morton Bug: 188908895 Link: https://lore.kernel.org/mm-commits/20210525000343.YBEWQU38O%25akpm@linux-foundation.org/T/#u Signed-off-by: Minchan Kim Change-Id: Ia077e0d88375d2b59fa5f2a8a530257c6558e8d5 --- mm/page_alloc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d71f6366ba9d..b29b84509e8a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -8617,8 +8617,10 @@ static int __alloc_contig_migrate_range(struct compact_control *cc, lru_cache_enable(); if (ret < 0) { - alloc_contig_dump_pages(&cc->migratepages); - page_pinner_mark_migration_failed_pages(&cc->migratepages); + if (ret == -EBUSY) { + alloc_contig_dump_pages(&cc->migratepages); + page_pinner_mark_migration_failed_pages(&cc->migratepages); + } putback_movable_pages(&cc->migratepages); return ret; }