[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <B60BDD1F-EABF-47D2-9FA5-146B53C2A304@nvidia.com>
Date: Thu, 23 Oct 2025 13:20:40 -0400
From: Zi Yan <ziy@...dia.com>
To: Pankaj Raghav <kernel@...kajraghav.com>
Cc: linmiaohe@...wei.com, david@...hat.com, jane.chu@...cle.com,
akpm@...ux-foundation.org, mcgrof@...nel.org, nao.horiguchi@...il.com,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>, Nico Pache <npache@...hat.com>,
Ryan Roberts <ryan.roberts@....com>, Dev Jain <dev.jain@....com>,
Barry Song <baohua@...nel.org>, Lance Yang <lance.yang@...ux.dev>,
"Matthew Wilcox (Oracle)" <willy@...radead.org>,
Wei Yang <richard.weiyang@...il.com>, Yang Shi <shy828301@...il.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, stable@...r.kernel.org
Subject: Re: [PATCH v4] mm/huge_memory: preserve PG_has_hwpoisoned if a folio
is split to >0 order
On 23 Oct 2025, at 7:10, Pankaj Raghav wrote:
> On 10/23/25 05:05, Zi Yan wrote:
>> folio split clears PG_has_hwpoisoned, but the flag should be preserved in
>> after-split folios containing pages with PG_hwpoisoned flag if the folio is
>> split to >0 order folios. Scan all pages in a to-be-split folio to
>> determine which after-split folios need the flag.
>>
>> An alternatives is to change PG_has_hwpoisoned to PG_maybe_hwpoisoned to
>> avoid the scan and set it on all after-split folios, but resulting false
>> positive has undesirable negative impact. To remove false positive, caller
>> of folio_test_has_hwpoisoned() and folio_contain_hwpoisoned_page() needs to
>> do the scan. That might be causing a hassle for current and future callers
>> and more costly than doing the scan in the split code. More details are
>> discussed in [1].
>>
>> This issue can be exposed via:
>> 1. splitting a has_hwpoisoned folio to >0 order from debugfs interface;
>
> Is it easy to add a selftest in split_huge_page_test for this scenario?
Probably, but I prefer to do this in a separate memory failure test.
I think the steps are:
0. set up a SIGBUS handler,
1. get a XFS image, like split_huge_page_test does,
2. set block size > page size,
3. fault in a large folio bigger than block size,
4. madvise(MADV_HWPOISON),
5. catch SIGBUS since the folio cannot be split to order-0 and check
the corresponding folio's has_hwpoison flag.
I will put this on my TODO list.
>
>> 2. truncating part of a has_hwpoisoned folio in
>> truncate_inode_partial_folio().
>>
> --
> Pankaj
--
Best Regards,
Yan, Zi
Powered by blists - more mailing lists