mm: show page state on migration failure
authorCho KyongHo <pullip.cho@samsung.com>
Wed, 20 Sep 2017 07:54:55 +0000 (16:54 +0900)
committerhskang <hs1218.kang@samsung.com>
Mon, 27 Aug 2018 07:22:39 +0000 (16:22 +0900)
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 1236449b4777be3cf61e8cd68616c2c3faa5fd9f..104b9746942d6d48e049cb7952f6c528691cef68 100644 (file)
@@ -1406,6 +1406,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++;