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