Re: [PATCH 00/15] ubifs folio conversion

Zhihao Cheng
2024-01-25T02:06:02Z

在 2024/1/24 13:01, Matthew Wilcox 写道:
> On Tue, Jan 23, 2024 at 08:33:49AM +0100, Richard Weinberger wrote:
>> Matthew,
>>
>> ----- Ursprüngliche Mail -----
>>> Von: "Matthew Wilcox" <willy@infradead.org>
>>> An: "richard" <richard@nod.at>
>>> CC: "Matthew Wilcox" <willy@infradead.org>, "linux-mtd" <linux-mtd@lists.infradead.org>
>>> Gesendet: Sonntag, 21. Januar 2024 00:08:08
>>> Betreff: [PATCH 00/15] ubifs folio conversion
>>
>>> This patchset converts ubifs to use folios throughout. I made some
>>> attempt to support large folios, but more work definitely needs to be
>>> done before it can be enabled. It's not clear to me whether it's worth
>>> doing, so I've left that for you ;-)
>>
>> what is the benefit of large folios?
>
> For another purpose, I just wrote this up. Possibly there are more
> benefits, but these are the ones I remembered just now:
>
> But why should a filesystem put in the effort to support large folios
> (aka multi-page folios)?
>
> Lower overheads
> Fewer calls to the page allocator
> Shorter LRU list helps vmscan age memory
> Fewer calls to the page cache for large read()/write()
> Fewer calls to the architecture code for handling faults in mmaped files
> Potential use of larger TLB entries (eg contPTE / NAPOT)
> Being a better kernel citizen
> The more code using large folios, the easier it is to allocate large folios
>
> The costs may outweigh the benefits. I would not invest time in making
> iso9660, adfs or efs support large folios. But for filesystems which
> are used every day (XFS, NFS, ext4, btrfs, ...) the benefit is very much
> worth the cost.

Ext4 could gain a good performance based on large folio[1], one
important reason is that blocks allocation method is changed as batch
allocation from one by one. There is a difference between UBIFS and ext4
on IO logic, so I'm not sure how much performance the large folio will
bring to UBIFS. I think page will be replaced by folio some day, so
these patches can be a folio switching and a preparation for large folio
support on UBIFS, personally I think.

[1] https://lwn.net/Articles/956575/