From: Qi Zheng <zhengqi.arch@bytedance.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: akpm@linux-foundation.org, arnd@arndb.de, muchun.song@linux.dev,
david@redhat.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH 1/2] mm: pgtable: add missing flag and statistics for kernel PTE page
Date: Mon, 5 Feb 2024 10:05:42 +0800 [thread overview]
Message-ID: <7fad74d9-134e-4606-abf7-3969ca01acef@bytedance.com> (raw)
In-Reply-To: <Zb_cmZByel4cULDP@casper.infradead.org>
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.
prev parent reply other threads:[~2024-02-05 2:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-01 8:05 Qi Zheng
2024-02-01 8:05 ` [PATCH 2/2] mm: pgtable: remove unnecessary split ptlock for kernel PMD page Qi Zheng
2024-02-02 3:16 ` Muchun Song
2024-02-04 18:54 ` Matthew Wilcox
2024-02-05 2:14 ` Qi Zheng
2024-02-02 2:47 ` [PATCH 1/2] mm: pgtable: add missing flag and statistics for kernel PTE page Muchun Song
2024-02-04 10:58 ` Mike Rapoport
2024-02-04 11:39 ` Qi Zheng
2024-02-04 12:15 ` Mike Rapoport
2024-02-04 16:26 ` Qi Zheng
2024-02-04 18:51 ` Matthew Wilcox
2024-02-05 2:05 ` Qi Zheng [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7fad74d9-134e-4606-abf7-3969ca01acef@bytedance.com \
--to=zhengqi.arch@bytedance.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=david@redhat.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox