Re: [PATCH] mm: Split huge PUD on wp_huge_pud fallback

From: David Hildenbrand
Date: Tue Aug 02 2022 - 10:59:40 EST


On 23.06.22 07:24, Gowans, James wrote:
> Currently the implementation will split the PUD when a fallback is taken
> inside the create_huge_pud function. This isn't where it should be done:
> the splitting should be done in wp_huge_pud, just like it's done for
> PMDs. Reason being that if a callback is taken during create, there is
> no PUD yet so nothing to split, whereas if a fallback is taken when
> encountering a write protection fault there is something to split.
>
> It looks like this was the original intention with the commit where the
> splitting was introduced, but somehow it got moved to the wrong place
> between v1 and v2 of the patch series. Rebase mistake perhaps.
>
> Fixes: 327e9fd48972 ("mm: Split huge pages on write-notify or COW")

Right, the functions should just look like create_huge_pmd()/wp_huge_pmd().

I do wonder if there was a reason to do it differently, though ... I
can't spot any in current code.

Acked-by: David Hildenbrand <david@xxxxxxxxxx>

--
Thanks,

David / dhildenb