]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mm/memory-failure: remove obsolete MF_MSG_DIFFERENT_COMPOUND
authorMiaohe Lin <linmiaohe@huawei.com>
Mon, 8 Jul 2024 03:05:44 +0000 (11:05 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 12 Jul 2024 22:52:22 +0000 (15:52 -0700)
The page cannot become compound pages again just after a folio is split as
an extra refcnt is held.  So the MF_MSG_DIFFERENT_COMPOUND case is
obsolete and can be removed to get rid of this false assumption and code
burden.  But add one WARN_ON() here to keep the situation clear.

Link: https://lkml.kernel.org/r/20240708030544.196919-1-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Borislav Petkov (AMD) <bp@alien8.de>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/ras/ras_event.h
mm/memory-failure.c

index 9bc707fe881900b44710ceba235874b0452b25f9..e5f7ee0864e78f83ed163d94300c53740b70ddf2 100644 (file)
@@ -356,7 +356,6 @@ TRACE_EVENT(aer_event,
 #define MF_PAGE_TYPE           \
        EM ( MF_MSG_KERNEL, "reserved kernel page" )                    \
        EM ( MF_MSG_KERNEL_HIGH_ORDER, "high-order kernel page" )       \
-       EM ( MF_MSG_DIFFERENT_COMPOUND, "different compound page after locking" ) \
        EM ( MF_MSG_HUGE, "huge page" )                                 \
        EM ( MF_MSG_FREE_HUGE, "free huge page" )                       \
        EM ( MF_MSG_GET_HWPOISON, "get hwpoison page" )                 \
index 16f8651436d5e71e82c4103c41777df94fe195a0..581d3e5c911758d09719f457ffa2fd65d953d222 100644 (file)
@@ -919,7 +919,6 @@ static const char *action_name[] = {
 static const char * const action_page_types[] = {
        [MF_MSG_KERNEL]                 = "reserved kernel page",
        [MF_MSG_KERNEL_HIGH_ORDER]      = "high-order kernel page",
-       [MF_MSG_DIFFERENT_COMPOUND]     = "different compound page after locking",
        [MF_MSG_HUGE]                   = "huge page",
        [MF_MSG_FREE_HUGE]              = "free huge page",
        [MF_MSG_GET_HWPOISON]           = "get hwpoison page",
@@ -2349,22 +2348,10 @@ try_again:
 
        /*
         * We're only intended to deal with the non-Compound page here.
-        * However, the page could have changed compound pages due to
-        * race window. If this happens, we could try again to hopefully
-        * handle the page next round.
+        * The page cannot become compound pages again as folio has been
+        * splited and extra refcnt is held.
         */
-       if (folio_test_large(folio)) {
-               if (retry) {
-                       ClearPageHWPoison(p);
-                       folio_unlock(folio);
-                       folio_put(folio);
-                       flags &= ~MF_COUNT_INCREASED;
-                       retry = false;
-                       goto try_again;
-               }
-               res = action_result(pfn, MF_MSG_DIFFERENT_COMPOUND, MF_IGNORED);
-               goto unlock_page;
-       }
+       WARN_ON(folio_test_large(folio));
 
        /*
         * We use page flags to determine what action should be taken, but