[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250331214132.49622459@gandalf.local.home>
Date: Mon, 31 Mar 2025 21:41:32 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.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 18:30:33 -0700
Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> On Mon, 31 Mar 2025 at 18:01, Steven Rostedt <rostedt@...dmis.org> wrote:
> >
> > Note, I believe that Linus brought up the issue that because this physical
> > memory is not currently part of the memory allocator (it's not aware of it
> > yet), that the getting struct page or a "pfn" for it may not be reliable.
>
> 'pfn' is always reliable.
>
> The pfn ('page frame number') is literally just the physical address
> expressed in 'page units', ie just shifted down by the page shift.
Ah, for some reason I thought the pfn mapped directly to struct pages.
>
> So pfn and phys_addr_t are interchangeable when it comes to mapping
> pages. The pfn is in fact often the preferred form, because on 32-bit
> architectures a pfn is 32-bit, but a phys_addr_t is often 64-bit and
> generates extra code.
>
> 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. But my memory of it was it was also used as an
index into a struct page array. Which is why I was thinking it was somewhat
interchangeable with struct page. But that was a long time ago when I was
an embedded developer, but I've only been using struct page for my needs in
the last couple of decades.
-- Steve
Powered by blists - more mailing lists