Re: [PATCH 18/46] mm/khugepaged: check if PTE table is empty in try_collapse_pte_mapped_thp()

From: Gregory Price

Date: Thu Oct 29 2026 - 10:20:29 EST


On 2026-10-29 12:01 +0100, David Hildenbrand (Arm) wrote:
> On 10/29/26 02:48, Gregory Price wrote:
> > On 2026-10-27 00:17 +0100, David Hildenbrand (Arm) wrote:
> >
> > I get that you want to avoid taking both locks while zapping, but
> > wouldn't it be simpler? I suppose we don't know what kind of
> > regressions might pop up with that though, bah.
>
> Exactly, that's the spirit of the original code. We would just block a 1GiB
> range of va space for the entire operation.
>
> If you think there is a more elegant way of doing it (while minimizing holding
> the pmd lock), please shoot :)
>

Elegant and this code do not appear to be compatible.

Another look, i think this is the preferred route.

Reviewed-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>

--
Gregory Price (Meta) <gourry@xxxxxxxxxx>