Re: [PATCH v2 01/22] x86/mm: split out preallocate_sub_pgd()

From: Dave Hansen

Date: Fri Mar 20 2026 - 16:00:18 EST


On 3/20/26 11:23, Brendan Jackman wrote:
> - /*
> - * The goal here is to allocate all possibly required
> - * hardware page tables pointed to by the top hardware
> - * level.

This comment is pretty important, IMNHO, and you zapped it.

The problem here is that the per-MM carved out space is PGD-sized. You
want to make sure there are page tables allocated for that space. But,
if you say "go allocate a p4d" then that will collapse down to doing
nothing on a 4-level system.

So, this is effectively:

Go allocate a p4d or pud, depending on if it's 4 or 5 level.
Basically, always allocate the level that the hardware PGD
points to.

Could we put a comment to that effect around somewhere, please?