Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/memory-failure: fix redundant updates for already poisoned pages

Duplicate memory errors can be reported by multiple sources.

Passing an already poisoned page to action_result() causes issues:

* The amount of hardware corrupted memory is incorrectly updated.
* Per NUMA node MF stats are incorrectly updated.
* Redundant "already poisoned" messages are printed.

Avoid those issues by:

* Skipping hardware corrupted memory updates for already poisoned pages.
* Skipping per NUMA node MF stats updates for already poisoned pages.
* Dropping redundant "already poisoned" messages.

Make MF_MSG_ALREADY_POISONED consistent with other action_page_types and
make calls to action_result() consistent for already poisoned normal pages
and huge pages.

Link: https://lkml.kernel.org/r/aLCiHMy12Ck3ouwC@hpe.com
Fixes: b8b9488d50b7 ("mm/memory-failure: improve memory failure action_result messages")
Signed-off-by: Kyle Meyer <kyle.meyer@hpe.com>
Reviewed-by: Jiaqi Yan <jiaqiyan@google.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Jane Chu <jane.chu@oracle.com>
Acked-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Borislav Betkov <bp@alien8.de>
Cc: Kyle Meyer <kyle.meyer@hpe.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Russ Anderson <russ.anderson@hpe.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Kyle Meyer and committed by
Andrew Morton
3be306cc e67f0bd0

+6 -7
+6 -7
mm/memory-failure.c
··· 956 956 [MF_MSG_BUDDY] = "free buddy page", 957 957 [MF_MSG_DAX] = "dax page", 958 958 [MF_MSG_UNSPLIT_THP] = "unsplit thp", 959 - [MF_MSG_ALREADY_POISONED] = "already poisoned", 959 + [MF_MSG_ALREADY_POISONED] = "already poisoned page", 960 960 [MF_MSG_UNKNOWN] = "unknown page", 961 961 }; 962 962 ··· 1349 1349 { 1350 1350 trace_memory_failure_event(pfn, type, result); 1351 1351 1352 - num_poisoned_pages_inc(pfn); 1353 - 1354 - update_per_node_mf_stats(pfn, result); 1352 + if (type != MF_MSG_ALREADY_POISONED) { 1353 + num_poisoned_pages_inc(pfn); 1354 + update_per_node_mf_stats(pfn, result); 1355 + } 1355 1356 1356 1357 pr_err("%#lx: recovery action for %s: %s\n", 1357 1358 pfn, action_page_types[type], action_name[result]); ··· 2095 2094 *hugetlb = 0; 2096 2095 return 0; 2097 2096 } else if (res == -EHWPOISON) { 2098 - pr_err("%#lx: already hardware poisoned\n", pfn); 2099 2097 if (flags & MF_ACTION_REQUIRED) { 2100 2098 folio = page_folio(p); 2101 2099 res = kill_accessing_process(current, folio_pfn(folio), flags); 2102 - action_result(pfn, MF_MSG_ALREADY_POISONED, MF_FAILED); 2103 2100 } 2101 + action_result(pfn, MF_MSG_ALREADY_POISONED, MF_FAILED); 2104 2102 return res; 2105 2103 } else if (res == -EBUSY) { 2106 2104 if (!(flags & MF_NO_RETRY)) { ··· 2285 2285 goto unlock_mutex; 2286 2286 2287 2287 if (TestSetPageHWPoison(p)) { 2288 - pr_err("%#lx: already hardware poisoned\n", pfn); 2289 2288 res = -EHWPOISON; 2290 2289 if (flags & MF_ACTION_REQUIRED) 2291 2290 res = kill_accessing_process(current, pfn, flags);