Re: [PATCH v2 1/2] tracing: ring-buffer: Have the ring buffer code do the vmap of physical memory

From: Ingo Molnar
Date: Tue Apr 01 2025 - 05:53:32 EST



* Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> On Mon, 31 Mar 2025 at 18:40, Steven Rostedt <rostedt@xxxxxxxxxxx> 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).

*Technically*, for those of us with a weakness for Git archeology, the
'PFN' term was first introduced in Linux with the MIPS port, which went
upstream via Linux 1.1.45, released on 1994/04/06, and had this in
include/asm-mips/mipsregs.h:

+/*
+ * Compute a vpn/pfn entry for EntryHi register
+ */
+#define VPN(addr,pagesizeshift) ((addr) & ~((1 << (pagesizeshift))-1))
+#define PFN(addr,pagesizeshift) (((addr) & ((1 << (pagesizeshift))-1)) << 6)

... while your Alpha port went upstream via 1.1.57, released on
1994/10/24, and the first mention of 'PFN' was in arch/alpha/mm/init.c,
introduced as part of 1.1.82, released 1995/01/16, almost a year later:

+unsigned long paging_init(unsigned long start_mem, unsigned long end_mem)
..
+ unsigned long pfn, nr;
+ if (cluster->usage & 1)
+ continue;
+ pfn = cluster->start_pfn;
+ nr = cluster->numpages;

So you don't appear to have dibs on the PFN name within Linux, although
I suspect MIPS and Alpha had it from a similar background. :-)

By the way, some quick review feedback on that patch: there should be
extra newlines after variable declarations - clearly the author is not
a good kernel programm... oh, never mind.

Thanks,

Ingo