mm: show page state on migration failure
authorCho KyongHo <pullip.cho@samsung.com>
Wed, 20 Sep 2017 07:54:55 +0000 (16:54 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:00 +0000 (20:23 +0300)
It is very useful to find the reason of the migration failure if we
know what the page is not migrated and the state of the page.

Change-Id: If6def51cbe8ac5b48a49c860a925633a36b498a2
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
mm/migrate.c

index 4662c5cba9339eac18c5eae5ddfaf42fa670cf26..798acd1aa97dbc8fa3d0e7e971beea1243b6997f 100644 (file)
@@ -1430,6 +1430,16 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,
                                                private, page, pass > 2, mode,
                                                reason);
 
+                       if ((rc != -EAGAIN) && (rc != MIGRATEPAGE_SUCCESS)) {
+                               phys_addr_t pa = page_to_phys(page);
+
+                               pr_err("%s failed(%d): PA%pa,mapcnt%d,cnt%d\n",
+                                       __func__, rc, &pa,
+                                       page_mapcount(page), page_count(page));
+
+                               dump_page_owner(page);
+                       }
+
                        switch(rc) {
                        case -ENOMEM:
                                nr_failed++;