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

From: Pedro Falcato

Date: Tue Jun 09 2026 - 17:02:28 EST


On Tue, Jun 09, 2026 at 07:02:25PM +0000, Gladyshev Ilya wrote:
> >
> > On Mon, 08 Jun 2026 21:53:01 +0000 "Gladyshev Ilya" <ilya.gladyshev@xxxxxxxxx> wrote:
> >
> > >
> > > This patch optimizes small file read performance and overall folio refcount
> > > scalability by refactoring page_ref_add_unless [core of folio_try_get].
> > > This is alternative approach to previous attempts to fix small read
> > > performance by avoiding refcount bumps [1][2].
> > >
> > Thanks. Nice numbers.
> >
> > AI review had some things to say:
> > https://sashiko.dev/#/patchset/df26082871b4c65b2bd38d409026237c08572836@xxxxxxxxx
>
> Will look into it, thanks
>
> > I'm not sure we want all those new VM_BUG_ON_PAGE() calls in the long
> > term. They look like development-time assistance. Perhaps you could
> > make those a standalone patch at tail-of-series so we can keep it in
> > linux-next for a couple of months then throw it away before any
> > upstreaming?
>
> They are cheap and can catch bugs that are very difficult to debug. So
> I'd like to keep them, if possible. Maybe change to WARN_ONCE, as David
> suggested.

Fully agree. I think it makes sense to keep these assertions for DEBUG_VM=y
(which no one should be running in prod anyway..)

--
Pedro