Re: [PATCH 3/5] mm/mglru: cache the last memcg node, make tail insertion constant time

From: Andrew Morton

Date: Sun Nov 01 2026 - 16:51:01 EST


On Wed, 14 Oct 2026 05:58:28 +0200 Max Kellermann <max.kellermann@xxxxxxxxx> wrote:

> On Wed, Oct 14, 2026 at 5:31 AM Ridong Chen <ridong.chen@xxxxxxxxx> wrote:
> > I've also submitted an RFC patch that addresses this issue.
>
> Oh, interesting! I did not know but your patch, but it looks very
> similar to mine (but without the hlist_nulls refactoring so yours
> comes with some code duplicating the hlist_nulls header).
>
> Too bad your RFC went nowhere, that would have saved us from a
> production incident... Anyway, even if neither gets merged, I'll keep
> my patches on our internal kernel fork, because they do help a lot
> with our workload.

hm, this was a bit of a fail, sorry about that.

We had a fairly modest RFC-stage patch which would have addressed the
issues you've encountered in 6.18.x. That got waylaid into more
ambitious re-engineering project which wouldn't have been backportable
and now this series which also won't be backportable.

So. Can someone please propose a nice simple quick-fix which we can
backport into the -stable stream while we work on the larger
rearchitecting projects?

I think that might be Max's [5/5]? Max, do you know whether that patch
alone will fix up 6.18.x, or do we also need to addressed that lengthy
spinlocked tail insertion?

If you think [5/5] is sufficient for -stable then please propose that as
a standalone cc:stable thing then we can look at the broader changes on
top.