Re: [PATCH mm-stable] mm/khugepaged: avoid unnecessary checking for swap entries when collapsing a mTHP

From: David Hildenbrand (Arm)

Date: Thu Aug 27 2026 - 07:05:44 EST


On 8/27/26 10:06, Baolin Wang wrote:
>
>
> On 8/26/26 3:24 AM, Pedro Demarchi Gomes wrote:
>> mthp_collapse() tries to swap in PTEs when collapsing a mTHP if there are any
>> swap PTEs in the PMD range, even if none of those swap PTEs are
>> actually part of the mTHP's range.
>
> Are you sure? I wonder how you tested your patch? Because we never swapin PTEs
> for mTHP collapse, see the code in __collapse_huge_page_swapin():

I'm confused as well, this doesn't really make sense.

--
Cheers,

David