Re: [PATCH] mm/memory_failure: reject unsupported non-folio compound page
From: Harry Yoo
Date: Wed Feb 04 2026 - 22:35:57 EST
On Wed, Feb 04, 2026 at 07:56:03PM -0500, Zi Yan wrote:
> When !CONFIG_TRANSPARENT_HUGEPAGE, a non-folio compound page can appear in
> a userspace mapping via either vm_insert_*() functions or
> vm_operatios_struct->fault(). They are not folios, thus should not be
> considered for folio operations like split. Change memory_failure() and
> soft_offline_page() to reject these non-folio compound pages as
> EOPNOTSUPP.
>
> Add PageNonFolioCompound() helper function. This function is functionally
> equivalent to folio_test_large() && !folio_test_large_rmappable(), but it
> is supposed to be used on struct page. So open code it instead.
>
> Fixes: 689b8986776c ("mm/memory-failure: improve large block size folio handling")
> Reported-by: 是参差 <shicenci@xxxxxxxxx>
> Closes: https://lore.kernel.org/all/PS1PPF7E1D7501F1E4F4441E7ECD056DEADAB98A@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
> Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
> ---
Looks good to me,
Acked-by: Harry Yoo <harry.yoo@xxxxxxxxxx>
--
Cheers,
Harry / Hyeonggon