From: Vlastimil Babka Date: Fri, 6 Nov 2015 02:47:03 +0000 (-0800) Subject: mm, migrate: count pages failing all retries in vmstat and tracepoint X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f2f81fb2b72b83b661b11da6f1b0bd3526706278;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git mm, migrate: count pages failing all retries in vmstat and tracepoint Migration tries up to 10 times to migrate pages that return -EAGAIN until it gives up. If some pages fail all retries, they are counted towards the number of failed pages that migrate_pages() returns. They should also be counted in the /proc/vmstat pgmigrate_fail and in the mm_migrate_pages tracepoint. Signed-off-by: Vlastimil Babka Acked-by: David Rientjes Cc: Naoya Horiguchi Cc: "Kirill A. Shutemov" Cc: "Aneesh Kumar K.V" Cc: Konstantin Khlebnikov Cc: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/migrate.c b/mm/migrate.c index 842ecd7aaf7f..94961f4654b7 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1169,7 +1169,8 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, } } } - rc = nr_failed + retry; + nr_failed += retry; + rc = nr_failed; out: if (nr_succeeded) count_vm_events(PGMIGRATE_SUCCESS, nr_succeeded);