[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wjijTKpotANjhqoKrEFh=B=RLrfGWa7OFB2WJ9RU8jaaA@mail.gmail.com>
Date: Mon, 31 Mar 2025 18:55:43 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Jann Horn <jannh@...gle.com>, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, Masami Hiramatsu <mhiramat@...nel.org>,
Mark Rutland <mark.rutland@....com>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Andrew Morton <akpm@...ux-foundation.org>, Vincent Donnefort <vdonnefort@...gle.com>,
Vlastimil Babka <vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>, Kees Cook <kees@...nel.org>,
Tony Luck <tony.luck@...el.com>, "Guilherme G. Piccoli" <gpiccoli@...lia.com>,
linux-hardening@...r.kernel.org, Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH v2 1/2] tracing: ring-buffer: Have the ring buffer code do
the vmap of physical memory
On Mon, 31 Mar 2025 at 18:40, Steven Rostedt <rostedt@...dmis.org> wrote:
> >
> > I think 'pfn' was introduced as a name ong long ago because it was
> > what the alpha architecture used in the VM documentation. It probably
> > predates that too, but it's where I got it from, iirc.
> >
>
> It is old, as I remember using it when I first started Linux kernel
> development back in 1998.
So I did the alpha port in '95, but I meant that the 'page frame
number' as a name may well have roots that go much further back. I
only know it from the alpha architecture docs.
Google only seems to find the modern Linux use, but I wouldn't be
surprised if the alpha architects got it from some much older use (I
would suspect VMS).
> But my memory of it was it was also used as an
> index into a struct page array.
So typically, the pfn is what is used to translate different kinds of addresses.
And yes, one such translation is "turn virtual address into physical
address, then turn that into the pfn, and then use that to index the
array of 'struct page'.
Few places use the pfn itself as the primary thing, but one of those
few things is the low-level page table code. Because page table
entries are literally a combination of the pfn and various per-page
information (protection bits, cacheability, stuff like that).
So to the page table code, 'pfn' is kind of fundamental.
Example: the actual low-level "create a page table entry" is
"pfn_pte()" which takes a pfn and the protection bits.
That's the basis from which all the other page table entry functions
are based on, even if you often have wrapper helpers to hide the 'pfn'
part from users, and you might have seen mk_pte() which takes a
'struct page' and the protection bits. That one just turns the page
into a pfn and then used pfn_pte().
Linus
Powered by blists - more mailing lists