Re: [RFC PATCH v3 2/3] mm: Add PUD level pagetable account

From: Baolin Wang
Date: Sun Jul 03 2022 - 11:07:53 EST




On 7/3/2022 10:52 PM, Matthew Wilcox wrote:
On Sun, Jul 03, 2022 at 10:06:32PM +0800, Baolin Wang wrote:
So for kernel pte page table allocation, I need another similar helpers like
below. However they do the samething with
pgtable_pud_page_ctor/pgtable_pud_page_dtor, so I am not sure this is good
for adding these duplicate code.

Why do we want to account kernel PTE page tables in NR_PAGETABLE?
I think that's confusing.

Why this will confuse you? I think it is inconsistent that kernel PTE page tables are not accounted, because we will account PMD/PUD level page tables no matter they are userspace pagetable pages or kernel pagetable pages.

Moreover the the vmalloc()/vmap() can consume some kernel pagetable pages, which should be accounted.