Re: [PATCH] x86/mm: Clear PUD entry before populating PMD table when splitting 1GB page in phys_pud_init
From: Dave Hansen
Date: Mon Jul 20 2026 - 09:35:25 EST
On 7/19/26 11:26, Phineas Su wrote:
> When phys_pud_init() splits an existing 1 GB huge page (pud_leaf(*pud))
> into PMD table entries, it extracts the page protection attributes but
> does not clear the existing PUD entry (*pud).
>
> Subsequently, pud_populate_init() -> set_pud_safe() is invoked to link
> the new PMD table. Because *pud is still populated with the 1 GB huge
> page entry, set_pud_safe() detects a present entry that differs from the
> new PMD table pointer, triggering a WARN_ON_ONCE call trace in dmesg:
>
> WARNING: CPU: 0 PID: 0 at arch/x86/mm/init_64.c:89 phys_pud_init+0x2d6/0x390
>
> Call pud_clear(pud) right after extracting protection attributes when
> splitting the 1 GB page so that set_pud_safe() can populate the PMD
> table cleanly without issuing a warning.
Why aren't we running in to this left and right? I wouldn't think
splitting a PUD would be _that_ rare.