Re: [PATCH v6 0/3] mm: improve folio refcount scalability

From: Andrew Morton

Date: Sun Sep 13 2026 - 20:06:26 EST


On Sat, 12 Sep 2026 22:50:07 +0300 Ilya Gladyshev <ilya.gladyshev@xxxxxxxxx> wrote:

> From: Gladyshev Ilya <ilya.gladyshev@xxxxxxxxx>
>
> Recap
> -----
>
> This patchset addresses a scalability issue of a folio's add_unless() operation,
> noticeable during contended IO reads from the same page [folio_try_get()]. The
> main idea is to replace CAS loop with optimistic increment (and deal with
> failure later). This requires splitting refcount into counter and separate
> "dead/frozen" bit.
>
> To allow for such modification, this patchset also slightly refactors page_ref
> API, consolidating all implementation logic inside mm headers. For more
> information, check individual commit messages. The original performance issue
> and previous attempts by other people can be found in [1][2].
>
> Performance
> -----------
>
> To my regret, I don't have any access to high-core CPUs that I can
> benchmark on, and a 12 vcpu laptop isn't really a scalability test. So,
> here I can only paste my previous measurements on Linux 6.15. To be fair,
> none of the related code paths really changed, so I don't expect any changes in the
> numbers here.

>From a quick eyeballing, this patchset seems to provide performance
gains which are similar to Kiryl's ill-fated "mm/filemap: Implement
fast short reads" [2]. Is that accurate?

> [1]: https://lore.kernel.org/linux-mm/CAHk-=wj00-nGmXEkxY=-=Z_qP6kiGUziSFvxHJ9N-cLWry5zpA@xxxxxxxxxxxxxx/
> [2]: https://lore.kernel.org/linux-mm/20251017141536.577466-1-kirill@xxxxxxxxxxxxx/
> [3]: https://lore.kernel.org/all/aqAIFV4nOGPbWiDS@thinkstation/