* [PATCH 6.6.y] mm/memory-failure: fix missing ->mf_stats count when hugetlb folio already poisoned
@ 2026-07-21 12:19 Qi Xi
2026-07-21 14:11 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Qi Xi @ 2026-07-21 12:19 UTC (permalink / raw)
To: stable
Cc: Naoya Horiguchi, Andrew Morton, Miaohe Lin, Sasha Levin,
Jane Chu, Greg Kroah-Hartman, linux-mm, linux-kernel, sunnanyong,
wangkefeng.wang, xiqi2
[ Upstream commit a148a2040191b12b45b82cb29c281cb3036baf90 ]
When a new subpage is poisoned on a hugetlb folio that has already been
marked hwpoison (MF_HUGETLB_FOLIO_PRE_POISONED), hugetlb_update_hwpoison()
increments num_poisoned_pages directly, but the per-node ->mf_stats is
not updated because this path bypasses action_result().
The upstream commit fixed this by routing all counting through
action_result(), but the backport to 6.6 as commit 252bb328b36f applied
only the refactoring without the core counting fix. This patch adds the
missing update_per_node_mf_stats() call to fix the inconsistency.
Fixes: 252bb328b36f ("mm/memory-failure: fix missing ->mf_stats count in hugetlb poison")
Signed-off-by: Qi Xi <xiqi2@huawei.com>
---
mm/memory-failure.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 86cdf36ee3bb..5f9203bf8ec1 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1947,8 +1947,10 @@ static int hugetlb_update_hwpoison(struct folio *folio, struct page *page)
raw_hwp->page = page;
llist_add(&raw_hwp->node, head);
/* the first error event will be counted in action_result(). */
- if (ret)
+ if (ret) {
num_poisoned_pages_inc(page_to_pfn(page));
+ update_per_node_mf_stats(page_to_pfn(page), MF_FAILED);
+ }
} else {
/*
* Failed to save raw error info. We no longer trace all
--
2.33.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 6.6.y] mm/memory-failure: fix missing ->mf_stats count when hugetlb folio already poisoned
2026-07-21 12:19 [PATCH 6.6.y] mm/memory-failure: fix missing ->mf_stats count when hugetlb folio already poisoned Qi Xi
@ 2026-07-21 14:11 ` Greg Kroah-Hartman
2026-07-23 2:05 ` Qi Xi
0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2026-07-21 14:11 UTC (permalink / raw)
To: Qi Xi
Cc: stable, Naoya Horiguchi, Andrew Morton, Miaohe Lin, Sasha Levin,
Jane Chu, linux-mm, linux-kernel, sunnanyong, wangkefeng.wang
On Tue, Jul 21, 2026 at 08:19:56PM +0800, Qi Xi wrote:
> [ Upstream commit a148a2040191b12b45b82cb29c281cb3036baf90 ]
That is not what this commit is :(
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 6.6.y] mm/memory-failure: fix missing ->mf_stats count when hugetlb folio already poisoned
2026-07-21 14:11 ` Greg Kroah-Hartman
@ 2026-07-23 2:05 ` Qi Xi
0 siblings, 0 replies; 3+ messages in thread
From: Qi Xi @ 2026-07-23 2:05 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: stable, Naoya Horiguchi, Andrew Morton, Miaohe Lin, Sasha Levin,
Jane Chu, linux-mm, linux-kernel, sunnanyong, wangkefeng.wang,
david
You're right, I apologize for the misleading tag. This patch is a
follow-up fix for the defective backport 252bb328b36f — the bug does
not exist on mainline, so it's not a direct backport of any upstream
commit. I'll correct this in the next version.
Also, as in your earlier comment on the v1 thread about needing
maintainer acks — I'll ask for feedback from maintainers first before
sending the next revision.
Thanks,
Qi
On 21/07/2026 22:11, Greg Kroah-Hartman wrote:
> On Tue, Jul 21, 2026 at 08:19:56PM +0800, Qi Xi wrote:
>> [ Upstream commit a148a2040191b12b45b82cb29c281cb3036baf90 ]
> That is not what this commit is :(
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-23 2:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-21 12:19 [PATCH 6.6.y] mm/memory-failure: fix missing ->mf_stats count when hugetlb folio already poisoned Qi Xi
2026-07-21 14:11 ` Greg Kroah-Hartman
2026-07-23 2:05 ` Qi Xi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®