mm/slab: use more appropriate condition check for debug_pagealloc
[firefly-linux-kernel-4.4.55.git] / mm / memory-failure.c
index 750b7893ee3ac840205299417ac1600c0cc16ebc..43aee7ab143efeff3639dbdaab957ae7ca621625 100644 (file)
@@ -1619,12 +1619,8 @@ static int soft_offline_huge_page(struct page *page, int flags)
        if (ret) {
                pr_info("soft offline: %#lx: migration failed %d, type %lx\n",
                        pfn, ret, page->flags);
-               /*
-                * We know that soft_offline_huge_page() tries to migrate
-                * only one hugepage pointed to by hpage, so we need not
-                * run through the pagelist here.
-                */
-               putback_active_hugepage(hpage);
+               if (!list_empty(&pagelist))
+                       putback_movable_pages(&pagelist);
                if (ret > 0)
                        ret = -EIO;
        } else {