Re: [PATCH v2 6/7] x86/mm: remove p4d_leaf definition
From: Baoquan He
Date: Thu Apr 03 2025 - 09:44:45 EST
On 04/01/25 at 09:20am, Ingo Molnar wrote:
>
> * Baoquan He <bhe@xxxxxxxxxx> wrote:
>
> > > So the above comment should have said '256 TB' pages, unless
> > > there's some naming weirdness I missed.
> >
> > Hmm, there could be misunderstanding here. In 5-level paging, PGD is
> > the highest level, P4D is the next level of PGD. You may have
> > reversed their order.
>
> Erm, yes indeed I flipped those two, so the correct table should be:
>
> - level 0: 4K pages
> - level 1: 512x 4K = 2MB 'large' pages
> - level 2: 512x 2MB = 1GB 'huge' pages
> - level 3: 512x 1GB = 512GB 'P4D' pages
> - level 4: 512x 512GB = 256TB 'PGD' pages
>
> I'm wondering whether 512GB pages will be called 'terapages'. ;-)
Forgot replying to this one.
With my understanding, MM usually don't name large page of different
size a specific name, just call them hugepage + size, e.g 2M huge page,
or 1G huge page. Sometime when we build mapping for them, we will call
them PMD hugepage or PUD hugepage.
I remember in x86 ARCH direct mapping is built with invocation of
init_mem_mapping(), and the mapping to 2M or 1G directly is called
large page mapping or PMD/PUD huge page mapping. They are similar.
Hope other MM people can correct me if I am wrong.