Re: [MAINTAINERS/KERNEL SUMMIT] Trust and maintenance of file systems

Linus Torvalds
2023-09-19T17:15:55Z

On Tue, 19 Sept 2023 at 09:45, Matthew Wilcox <willy@infradead.org> wrote:
>
> What I was trying to say was that if the buffer cache actually supported
> it, large folios and buffer_heads wouldn't perform horribly together,
> unless you had a badly fragmented file.

I think it would work in theory... I don't see a _practical_ example
of a filesystem that would use it, but maybe you had something
specific in mind?

> eg you could allocate a 256kB folio, then ask the filesystem to
> create buffer_heads for it, and maybe it would come back with a list
> of four buffer_heads, the first representing the extent from 0-32kB,
> the second 32kB-164kB, the third 164kB-252kB and the fourth 252kB-256kB.
> Wherever there were physical discontiguities in the file.

That *is* technically something that the buffer cache supports, but I
don't think it has ever been done.

So while it's technically possible, it's never been tested, so it
would almost certainly show some (potentially serious) issues.

And we obviously don't have the helper functions to create such a list
of buffer heads (ie all the existing "grow buffers" just take one size
and create a uniform set of buffers in the page/folio).

Linus