Re: [GIT PULL] Memory folios for v5.15

From: Nicholas Piggin
Date: Thu Aug 26 2021 - 00:02:23 EST


Excerpts from Christoph Hellwig's message of August 25, 2021 4:32 pm:
> On Tue, Aug 24, 2021 at 03:44:48PM -0400, Theodore Ts'o wrote:
>> The problem is whether we use struct head_page, or folio, or mempages,
>> we're going to be subsystem users' faces. And people who are using it
>> every day will eventually get used to anything, whether it's "folio"
>> or "xmoqax", we sould give a thought to newcomers to Linux file system
>> code. If they see things like "read_folio()", they are going to be
>> far more confused than "read_pages()" or "read_mempages()".
>
> Are they? It's not like page isn't some randomly made up term
> as well, just one that had a lot more time to spread.
>
>> So if someone sees "kmem_cache_alloc()", they can probably make a
>> guess what it means, and it's memorable once they learn it.
>> Similarly, something like "head_page", or "mempages" is going to a bit
>> more obvious to a kernel newbie. So if we can make a tiny gesture
>> towards comprehensibility, it would be good to do so while it's still
>> easier to change the name.
>
> All this sounds really weird to me. I doubt there is any name that
> nicely explains "structure used to manage arbitrary power of two
> units of memory in the kernel" very well.

Cluster is easily understandable to a filesystem developer as contiguous
set of one or more, probably aligned and sized to power of 2. Swap
subsystem in mm uses it (maybe because it's disk adjacent, but it does
have page clusters) so mm developers would be fine with it too. Sadly
you might have to call it page_cluster to avoid confusion with block
clusters in fs then it gets a bit long.

Superpage could be different enough from huge page that implies one page
of a particular large size (even though some other OS might use it for
that), but a super set of pages, which could be 1 or more.

Thanks,
Nick