Re: [RFC PATCH 0/2] mm: improve folio refcount scalability

From: Kiryl Shutsemau

Date: Mon Jan 12 2026 - 11:18:00 EST


On Mon, Jan 12, 2026 at 05:32:10PM +0300, Gladyshev Ilya wrote:
> On 1/12/2026 2:49 PM, Kiryl Shutsemau wrote:
> > On Mon, Jan 12, 2026 at 11:30:38AM +0300, Gladyshev Ilya wrote:
> > > Gentle ping on this proposal
> >
> > I generally like the idea, but I would like to hear from folks who
> > actually understand serialization.
> >
> > Also, do you have number for "a full CAS loop when the counter is
> > approaching overflow" thing?
> >
> I am not sure that overflow is a real problem because you need a very
> specific race condition over a long time to achieve it...

Yes. But if the page is popular for pinning, GUP_PIN_COUNTING_BIAS can
cut the "very long time" substantially.

> But as a safeguard, everything lower than 2^31 - #max concurrent
> accesses (~#num cpu) should work, so let's say 2^30

What I meant is when we put a branch/loop in the hot path, your
performance numbers will likely not look as attractive. Am I wrong?

--
Kiryl Shutsemau / Kirill A. Shutemov