]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm: memory-failure: kill soft_offline_free_page()
authorKefeng Wang <wangkefeng.wang@huawei.com>
Fri, 19 Aug 2022 03:34:01 +0000 (11:34 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 22 Aug 2022 22:58:16 +0000 (15:58 -0700)
Open-code the page_handle_poison() into soft_offline_page() and kill
unneeded soft_offline_free_page().

Link: https://lkml.kernel.org/r/20220819033402.156519-1-wangkefeng.wang@huawei.com
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory-failure.c

index c831c41bb0929679708d73c5f20db6adc9c4d1be..0681f5aebf0043b2bd9449bd52c97ec85ca9a2c9 100644 (file)
@@ -2515,16 +2515,6 @@ static int soft_offline_in_use_page(struct page *page)
        return __soft_offline_page(page);
 }
 
-static int soft_offline_free_page(struct page *page)
-{
-       int rc = 0;
-
-       if (!page_handle_poison(page, true, false))
-               rc = -EBUSY;
-
-       return rc;
-}
-
 static void put_ref_page(struct page *page)
 {
        if (page)
@@ -2600,7 +2590,7 @@ retry:
        if (ret > 0) {
                ret = soft_offline_in_use_page(page);
        } else if (ret == 0) {
-               if (soft_offline_free_page(page) && try_again) {
+               if (!page_handle_poison(page, true, false) && try_again) {
                        try_again = false;
                        flags &= ~MF_COUNT_INCREASED;
                        goto retry;