linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kairui Song <ryncsn@gmail.com>
To: Barry Song <21cnbao@gmail.com>, David Rientjes <rientjes@google.com>
Cc: axelrasmussen@google.com, linux-mm@kvack.org,
	 lsf-pc@lists.linux-foundation.org, weixugc@google.com,
	yuanchu@google.com
Subject: Re: [LSF/MM/BPF] Improving MGLRU
Date: Mon, 2 Mar 2026 19:10:10 +0800	[thread overview]
Message-ID: <CAMgjq7CDgap5pe_xVemow+SbaRW+ERXZBZvkymhFWZQZdDM2Kw@mail.gmail.com> (raw)
In-Reply-To: <20260227033013.94901-1-21cnbao@gmail.com>

On Fri, Feb 27, 2026 at 11:30 AM Barry Song <21cnbao@gmail.com> wrote:
>
> > 4. MGLRU's swappiness is kind of useless in some situations compared to
> >   Active / Inactive LRU, since its force protects the youngest two gen, so
> >   quite often we can only reclaim one type of folios. To workaround that, the
> >   user usually runs force aging before reclaim. So, can we just remove the
> >   force protection of the youngest two gens?
>
> I guess not—MGLRU needs at least two generations to function,
> similar to active and inactive lists, meaning it requires two lists.

Hi Barry,

You are right. But I think that doesn't mean we can't never reclaim
the folios in the oldest gen? Or maybe, just let the kernel itself
perform aging when one type of folios is not reclaimable.

We have an internal workaround for forces aging, and waits for sync
aging if one type of folios are not reclaimable (without the wait, we
still hit the MIN_NR_GEN protect again since aging is not finished).
And without the MIN_NR_GEN protection we might end up over reclaiming
without aging.

The problem with that is that the OOM killer became very slow to
trigger since aging is costly, so the system will hang for minutes
before OOM is triggered when it should get triggered immediately.

And for the OOM part I saw David Rientjes also mentioned the TTL
config in MGLRU, I do think TTL is a good idea, we just need to figure
out a good way to make better use of that.

I think a feasible solution might be (just idea): implement async
aging; decouple aging and reclaim, reclaim just keep shrinking
whatever is oldest; and optionally improve thrashing and OOM with TTL.


  reply	other threads:[~2026-03-02 11:10 UTC|newest]

Thread overview: 17+ 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-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 [this message]
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=CAMgjq7CDgap5pe_xVemow+SbaRW+ERXZBZvkymhFWZQZdDM2Kw@mail.gmail.com \
    --to=ryncsn@gmail.com \
    --cc=21cnbao@gmail.com \
    --cc=axelrasmussen@google.com \
    --cc=linux-mm@kvack.org \
    --cc=lsf-pc@lists.linux-foundation.org \
    --cc=rientjes@google.com \
    --cc=weixugc@google.com \
    --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