Re: [PATCH v5 00/27] Memory Folios

From: Christoph Hellwig
Date: Wed Mar 31 2021 - 10:56:46 EST


On Tue, Mar 30, 2021 at 03:30:54PM -0400, Johannes Weiner wrote:
> > Eventually, I want to make struct page optional for allocations. It's too
> > small for some things (allocating page tables, for example), and overly
> > large for others (allocating a 2MB page, networking page_pool). I don't
> > want to change its size in the meantime; having a struct page refer to
> > PAGE_SIZE bytes is something that's quite deeply baked in.
>
> Right, I think it's overloaded and it needs to go away from many
> contexts it's used in today.

FYI, one unrelated usage is that in many contet we use a struct page and
an offset to describe locations for I/O (block layer, networking, DMA
API). With huge pages and merged I/O buffers this representation
actually becomes increasingly painful.

And a little bit back to the topic: I think the folio as in the
current patchset is incredibly useful and someting we need like
yesterday to help file systems and the block layer to cope with
huge and compound pages of all sorts. Once willy sends out a new
version with the accumulated fixes I'm ready to ACK the whole thing.