From: Jiaqi Yan <jiaqiyan@google.com>
To: Zi Yan <ziy@nvidia.com>
Cc: jackmanb@google.com, hannes@cmpxchg.org, linmiaohe@huawei.com,
harry.yoo@oracle.com, willy@infradead.org,
nao.horiguchi@gmail.com, david@redhat.com,
lorenzo.stoakes@oracle.com, william.roche@oracle.com,
tony.luck@intel.com, wangkefeng.wang@huawei.com,
jane.chu@oracle.com, akpm@linux-foundation.org,
osalvador@suse.de, muchun.song@linux.dev, rientjes@google.com,
duenwen@google.com, jthoughton@google.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Liam.Howlett@oracle.com,
vbabka@suse.cz, rppt@kernel.org, surenb@google.com,
mhocko@suse.com
Subject: Re: [PATCH v3 1/3] mm/memory-failure: set has_hwpoisoned flags on HugeTLB folio
Date: Thu, 15 Jan 2026 10:29:37 -0800 [thread overview]
Message-ID: <CACw3F53EJCi1EasevMptcQs_TBy7-7qEaKxZEzH8GP7QzunMQA@mail.gmail.com> (raw)
In-Reply-To: <44A610FC-3154-4FF4-A940-12ECB63068D5@nvidia.com>
On Sun, Jan 11, 2026 at 6:50 PM Zi Yan <ziy@nvidia.com> wrote:
>
> On 11 Jan 2026, at 19:49, Jiaqi Yan wrote:
>
> > When a free HWPoison HugeTLB folio is dissolved, it becomes
> > non-HugeTLB and is released to buddy allocator as a high-order
> > folio.
> >
> > Set has_hwpoisoned flags on the high-order folio so that buddy
> > allocator can tell that it contains certain HWPoison page(s).
> > This is a prepare change for buddy allocator to handle only the
> > high-order HWPoison folio differently.
> >
> > This cannot be done with hwpoison flag because users cannot tell
> > from the case that the page with hwpoison is hardware corrupted.
> >
> > Signed-off-by: Jiaqi Yan <jiaqiyan@google.com>
> > ---
> > include/linux/page-flags.h | 2 +-
> > mm/memory-failure.c | 1 +
> > 2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> > index f7a0e4af0c734..d13835e265952 100644
> > --- a/include/linux/page-flags.h
> > +++ b/include/linux/page-flags.h
> > @@ -904,7 +904,7 @@ static inline int PageTransCompound(const struct page *page)
> > TESTPAGEFLAG_FALSE(TransCompound, transcompound)
> > #endif
> >
> > -#if defined(CONFIG_MEMORY_FAILURE) && defined(CONFIG_TRANSPARENT_HUGEPAGE)
> > +#if defined(CONFIG_MEMORY_FAILURE) && (defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLB_PAGE))
> > /*
> > * PageHasHWPoisoned indicates that at least one subpage is hwpoisoned in the
> > * compound page.
> > diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> > index fbc5a01260c89..d204de6c9792a 100644
> > --- a/mm/memory-failure.c
> > +++ b/mm/memory-failure.c
> > @@ -1952,6 +1952,7 @@ void folio_clear_hugetlb_hwpoison(struct folio *folio)
> > if (folio_test_hugetlb_vmemmap_optimized(folio))
> > return;
> > folio_clear_hwpoison(folio);
> > + folio_set_has_hwpoisoned(folio);
> > folio_free_raw_hwp(folio, true);
> > }
>
> Should this patch go after Patch 2 where has_hwpoisoned folio handling code
> is added?
Hi Zi, thanks for the comment. Will reorder this one.
I initially thought this patch was for preparation. However, if I look
at patch 2 differently: it enables page_alloc to handle
PG_has_hwpoisoned folios generally, not only for HugeTLB, but also for
split-failed THP compound pages. Then this one can be just to make
HugeTLB start to use patch 2.
>
> --
> Best Regards,
> Yan, Zi
next prev parent reply other threads:[~2026-01-15 18:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-12 0:49 [PATCH v3 0/3] Only free healthy pages in high-order has_hwpoisoned folio Jiaqi Yan
2026-01-12 0:49 ` [PATCH v3 1/3] mm/memory-failure: set has_hwpoisoned flags on HugeTLB folio Jiaqi Yan
2026-01-12 2:50 ` Zi Yan
2026-01-15 18:29 ` Jiaqi Yan [this message]
2026-01-12 0:49 ` [PATCH v3 2/3] mm/page_alloc: only free healthy pages in high-order has_hwpoisoned folio Jiaqi Yan
2026-01-13 5:39 ` Harry Yoo
2026-01-13 22:02 ` Zi Yan
2026-01-24 5:32 ` Jiaqi Yan
2026-01-15 3:10 ` Miaohe Lin
2026-01-24 5:32 ` Jiaqi Yan
2026-01-15 3:05 ` Miaohe Lin
2026-01-24 5:32 ` Jiaqi Yan
2026-01-15 20:42 ` David Hildenbrand (Red Hat)
2026-01-24 5:32 ` Jiaqi Yan
2026-01-12 0:49 ` [PATCH v3 3/3] mm/memory-failure: refactor page_handle_poison() Jiaqi Yan
2026-01-15 3:41 ` Miaohe Lin
2026-01-28 5:20 ` Jiaqi Yan
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=CACw3F53EJCi1EasevMptcQs_TBy7-7qEaKxZEzH8GP7QzunMQA@mail.gmail.com \
--to=jiaqiyan@google.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--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=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 \
--cc=ziy@nvidia.com \
/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