Re: [PATCH v8 09/15] mm: Remove locking mf_mutex in is_raw_hwpoison_page_in_hugepage()

Gregory Price <[email protected]>
Newsgroups org.kernel.vger.linux-fsdevel,org.kvack.linux-mm
Message-ID <anIUe_Zq8bFX0-Dk@gourry-fedora-PF4VCD3F>
On Fri, Jul 31, 2026 at 09:07:54PM +0100, Matthew Wilcox (Oracle) wrote:
> Sleeping in this kind of predicate is unexpected.  Add a new spinlock
> to protect access to the list, and turn it into a normal singly linked
> list now that it doesn't need to be a lockless list.
> 

Out of curiosity, wouldn't sleeping in this context not just be
unexpected but theoretically cause issues? (mid-poison, sleep, scheduled
process generates more poison on the same page...) - at a minimum this
takes a thread out of the future potential poison-generating pool?

I don't see any particular issue with the patch, just curious the
implication of removable sleepability from this context.

> Rename is_raw_hwpoison_page_in_hugepage() to hugetlb_page_hwpoison()
> and make it take the folio (since the callers naturally have the folio).
> Also remove the handling of non-hugetlb folios and make the arguments
> const.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>

Reviewed-by: Gregory Price (Meta) <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.