From: Gregory Price <gourry@gourry.net>
To: Barry Song <21cnbao@gmail.com>
Cc: willy@infradead.org, axelrasmussen@google.com,
linux-mm@kvack.org, lsf-pc@lists.linux-foundation.org,
ryncsn@gmail.com, weixugc@google.com, yuanchu@google.com
Subject: Re: [LSF/MM/BPF] Improving MGLRU
Date: Mon, 2 Mar 2026 12:46:23 -0500 [thread overview]
Message-ID: <aaXM7xNSJaJBsety@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <20260227043139.95115-1-21cnbao@gmail.com>
On Fri, Feb 27, 2026 at 12:31:39PM +0800, Barry Song wrote:
> >> MGLRU has been introduced in the mainline for years, but we still have two LRUs
> >> today. There are many reasons MGLRU is still not the only LRU implementation in
> >> the kernel.
>
> > To my mind, the biggest problem with MGLRU is that Google dumped it on us
> > and ran away. Commit 44958000bada claimed that it was now maintained and
> > added three people as maintainers. In the six months since that commit,
> > none of those three people have any commits in mm/! This is a shameful
> > state of affairs.
> >
> > I say rip it out.
>
> Hi Matthew,
> Can we keep it for now? Kairui, Zicheng, and I are working on it.
>
> From what I’ve seen, it performs much better than the active/inactive
> approach after applying a few vendor hooks on Android, such as forced
> aging and avoiding direct activation of read-ahead folios during page
> faults, among others. To be honest, performance was worse than
> active/inactive without those hooks, which are still not in mainline.
>
> It just needs more work. MGLRU has many strong design aspects, including
> using more generations to differentiate cold from hot, the look-around
> mechanism to reduce scanning overhead by leveraging cache locality,
> and data structure designs that minimize lock holding.
In presentations where the distribution of generations is shown for
different workloads, I've seen many bi-modal distributions for MGLRU
(where oldest and youngest contain the bulk of the folios).
It makes the value of multiple generations questionable - especially at
the level MGLRU emulates it right now (multiple generations PLUS multiple
tiers within those generations).
One of the issues with MGLRU is it's actually quite difficult to
determine which feature it introduces (there are 7 or 8 major features)
is responsible for producing any given effect on a workload.
In a random test over the weekend where I turned everything but
multiple generations off (no page table scan, no bloom filter, etc -
MGLRU just defaults to a multi-gen FIFO) I found that streaming
workloads did better this way.
Makes sense, given that MGLRU is trying to protect working set,
but I didn't expect it to be that dramatic.
It seems at best problematic to argue "We just need more heuristics!",
but clearly MGLRU "works, for some definition of the word works".
~Gregory
next prev parent reply other threads:[~2026-03-02 17:46 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-19 17:25 [LSF/MM/BPF TOPIC] " Kairui Song
2026-02-20 18:24 ` Johannes Weiner
2026-02-21 6:03 ` Kairui Song
2026-02-26 1:55 ` Kalesh Singh
2026-02-26 3:06 ` Kairui Song
2026-02-26 10:10 ` wangzicheng
2026-02-26 15:54 ` Matthew Wilcox
2026-02-27 4:31 ` [LSF/MM/BPF] " Barry Song
2026-03-02 17:46 ` Gregory Price [this message]
2026-02-27 17:55 ` [LSF/MM/BPF TOPIC] " Shakeel Butt
2026-02-27 18:50 ` Gregory Price
2026-02-27 3:30 ` [LSF/MM/BPF] " Barry Song
2026-03-02 11:10 ` Kairui Song
2026-02-27 7:11 ` [LSF/MM/BPF TOPIC] " David Rientjes
2026-02-27 10:29 ` Vernon Yang
2026-03-02 12:17 ` Kairui Song
-- strict thread matches above, loose matches on Subject: below --
2026-02-19 17:09 [LSF/MM/BPF] " Kairui Song
2026-02-24 17:19 ` Suren Baghdasaryan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aaXM7xNSJaJBsety@gourry-fedora-PF4VCD3F \
--to=gourry@gourry.net \
--cc=21cnbao@gmail.com \
--cc=axelrasmussen@google.com \
--cc=linux-mm@kvack.org \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=ryncsn@gmail.com \
--cc=weixugc@google.com \
--cc=willy@infradead.org \
--cc=yuanchu@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox