[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7fad74d9-134e-4606-abf7-3969ca01acef@bytedance.com>
Date: Mon, 5 Feb 2024 10:05:42 +0800
From: Qi Zheng <zhengqi.arch@...edance.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: akpm@...ux-foundation.org, arnd@...db.de, muchun.song@...ux.dev,
david@...hat.com, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
linux-arch@...r.kernel.org
Subject: Re: [PATCH 1/2] mm: pgtable: add missing flag and statistics for
kernel PTE page
Hi Matthew,
On 2024/2/5 02:51, Matthew Wilcox wrote:
> On Thu, Feb 01, 2024 at 04:05:40PM +0800, Qi Zheng wrote:
>> For kernel PTE page, we do not need to allocate and initialize its split
>> ptlock, but as a page table page, it's still necessary to add PG_table
>> flag and NR_PAGETABLE statistics for it.
>
> No, this is wrong.
>
> We do not account _kernel_ page tables to the _user_. Just because
> the kernel, say, called vmalloc() doesn't mean we should charge the
> task for it. Moreover, one task may call vmalloc() and a different task
> would then call vfree().
>
Got it. Thanks for providing this information!
> This is a can of worms you don't want to open. Why did you want to do
> this?
Ah, just because generic {pmd|pud}_alloc_one() has opened it. ;) And
When I looked through the commits (e.g. commit 1d40a5ea01d5), I couldn't
find the information you provided above. And that is why I CC'd you to
double check this, in case I might have overlooked some important
background information.
So we should actually fix generic {pmd|pud}_alloc_one() (and maybe some
implementation in the arch), right? And it would be better to add some
comments to clarify.
Thanks.
Powered by blists - more mailing lists