Re: [PATCH v4 01/15] docs/mm: add document for swap table
From: Chris Li
Date: Thu Sep 18 2025 - 00:51:15 EST
On Wed, Sep 17, 2025 at 4:50 PM Barry Song <21cnbao@xxxxxxxxx> wrote:
>
> > Perhaps you could describe the swap table as similar to a PTE page table
> > representing the swap cache mapping.
> > That is correct for most 32-bit and 64-bit systems,
> > but not for every machine.
> >
> > The only exception is a 32-bit system with a 64-bit physical address
> > (Large Physical Address Extension, LPAE), which uses a 4 KB PTE table
> > but a 2 KB swap table because the pointer is 32 bit while each page
> > table entry is 64 bit.
> >
> > Maybe we can simply say that the number of entries in the swap table
> > is the same as in a PTE page table?
>
> BTW, as Kairui mentioned, you plan to store the PFN instead of a
> pointer in phase 2.
Yes, let's update the document then and only then. Otherwise the
document will be mismatching the code and confuse the reader.
>
> I wonder whether we need to switch to atomic64_t on systems where the
> physical address is 64 bit but the virtual address is 32 bit :-)
It is possible we need 64 bit for the swap cache anyway for other
reasons when we get into the later phases. Again, let's deal with it
later.
Chris