From: Zi Yan <ziy@nvidia.com>
To: Boudewijn van der Heide <boudewijn@delta-utec.com>
Cc: jiaqiyan@google.com, Liam.Howlett@oracle.com,
akpm@linux-foundation.org, david@redhat.com, duenwen@google.com,
hannes@cmpxchg.org, harry.yoo@oracle.com, jackmanb@google.com,
jane.chu@oracle.com, jthoughton@google.com, linmiaohe@huawei.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
lorenzo.stoakes@oracle.com, mhocko@suse.com,
muchun.song@linux.dev, nao.horiguchi@gmail.com,
osalvador@suse.de, rientjes@google.com, rppt@kernel.org,
surenb@google.com, tony.luck@intel.com, vbabka@suse.cz,
wangkefeng.wang@huawei.com, william.roche@oracle.com,
willy@infradead.org
Subject: Re: [PATCH v4 0/3] Only free healthy pages in high-order has_hwpoisoned folio
Date: Wed, 04 Feb 2026 10:48:00 -0500 [thread overview]
Message-ID: <2C382EC0-0FB7-4882-8B87-E467454178D2@nvidia.com> (raw)
In-Reply-To: <20260204152352.55606-1-boudewijn@delta-utec.com>
On 4 Feb 2026, at 10:23, Boudewijn van der Heide wrote:
> Hi Jiaqi,
> Thanks for including the THP scenario.
>
>> Another similar situation is when a transparent huge page (THP)
>> is handled by MFR but splitting failed. Such THP will eventually
>> be released to buddy allocator when owning userspace processes
>> are gone, but with certain subpages having HWPoison [9].
>
> I think for failed-split THP, we need to do the following to support them:
>
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index cf0d526e6d41..3f727038f400 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -2479,6 +2479,7 @@ int memory_failure(unsigned long pfn, int flags)
> if (err || new_order) {
> /* get folio again in case the original one is split */
> folio = page_folio(p);
> + folio_set_has_hwpoisoned(folio);
> res = -EHWPOISON;
> kill_procs_now(p, pfn, flags, folio);
> put_page(p);
>
> We set the PG_has_hwpoison flag here again,
> because when the split partially succeeds (new_order > 0),
> page_folio(p) returns a new smaller-order folio that doesn't have the flag set.
No, split code[1] sets has_hwpoison flag when it split a folio to a non-0 order
folios. If you do not see it in your kernel code, you might need to update
your kernel to latest stable one or one newer than or equal to 6.18.
[1] https://elixir.bootlin.com/linux/v6.18/source/mm/huge_memory.c#L3343
Best Regards,
Yan, Zi
next prev parent reply other threads:[~2026-02-04 15:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-02 19:41 Jiaqi Yan
2026-02-02 19:41 ` [PATCH v4 1/3] mm/page_alloc: only " Jiaqi Yan
2026-02-02 19:41 ` [PATCH v4 2/3] mm/memory-failure: set has_hwpoisoned flags on dissolved HugeTLB folio Jiaqi Yan
2026-02-02 19:41 ` [PATCH v4 3/3] mm/memory-failure: skip take_page_off_buddy after dissolving HWPoison HugeTLB page Jiaqi Yan
2026-02-04 15:23 ` [PATCH v4 0/3] Only free healthy pages in high-order has_hwpoisoned folio Boudewijn van der Heide
2026-02-04 15:48 ` Zi Yan [this message]
2026-02-06 16:16 ` Boudewijn van der Heide
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2C382EC0-0FB7-4882-8B87-E467454178D2@nvidia.com \
--to=ziy@nvidia.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=boudewijn@delta-utec.com \
--cc=david@redhat.com \
--cc=duenwen@google.com \
--cc=hannes@cmpxchg.org \
--cc=harry.yoo@oracle.com \
--cc=jackmanb@google.com \
--cc=jane.chu@oracle.com \
--cc=jiaqiyan@google.com \
--cc=jthoughton@google.com \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=muchun.song@linux.dev \
--cc=nao.horiguchi@gmail.com \
--cc=osalvador@suse.de \
--cc=rientjes@google.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=tony.luck@intel.com \
--cc=vbabka@suse.cz \
--cc=wangkefeng.wang@huawei.com \
--cc=william.roche@oracle.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox