From: Yafang Shao <laoar.shao@gmail.com>
To: Axel Rasmussen <axelrasmussen@google.com>
Cc: Barry Song <21cnbao@gmail.com>, Yuanchu Xie <yuanchu@google.com>,
Kairui Song <ryncsn@gmail.com>,
bingfangguo@tencent.com, lenohou@gmail.com,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, weixugc@google.com, wjl.linux@gmail.com,
yuzhao@google.com
Subject: Re: [PATCH] mm/mglru: fix cgroup OOM during MGLRU state switching
Date: Tue, 3 Mar 2026 10:43:46 +0800 [thread overview]
Message-ID: <CALOAHbC0XbvG4OCy94j+ZUyTZt65QB0Y=p1UwKvGcsgcWKy7mg@mail.gmail.com> (raw)
In-Reply-To: <CAJHvVci8nc-yTHkAbSEQQtqkRvgATJWcSTwBCY49A5W4AQcd7Q@mail.gmail.com>
On Tue, Mar 3, 2026 at 9:40 AM Axel Rasmussen <axelrasmussen@google.com> wrote:
>
> On Mon, Mar 2, 2026 at 5:34 PM Barry Song <21cnbao@gmail.com> wrote:
> >
> > On Tue, Mar 3, 2026 at 1:52 AM Yuanchu Xie <yuanchu@google.com> wrote:
> > >
> > > Hi Yafang,
> > >
> > > On Mon, Mar 2, 2026 at 8:36 AM Yafang Shao <laoar.shao@gmail.com> wrote:
> > > >
> > > > On Mon, Mar 2, 2026 at 5:48 PM Kairui Song <ryncsn@gmail.com> wrote:
> > > > >
> > > > > On Mon, Mar 2, 2026 at 5:20 PM Barry Song <21cnbao@gmail.com> wrote:
> > > > > >
> > > > > > On Mon, Mar 2, 2026 at 4:25 PM Yafang Shao <laoar.shao@gmail.com> wrote:
> > > > > > >
> > > > > > > The challenge we're currently facing is that we don't yet know which
> > > > > > > workloads would benefit from it ;)
> > > > > > > We do want to enable mglru on our production servers, but first we
> > > > > > > need to address the risk of OOM during the switch—that's exactly why
> > > > > > > we're proposing this patch.
> > > > > >
> > > > > > Nobody objects to your intention to fix it. I’m curious: to what
> > > > > > extent do we want to fix it? Do we aim to merely reduce the probability
> > > > > > of OOM and other mistakes, or do we want a complete fix that makes
> > > > > > the dynamic on/off fully safe?
> > > > >
> > > > > Yeah, I'm glad that more people are trying MGLRU and improving it.
> > > > >
> > > > > We also have an downstream fix for the OOM on switch issue, but that's
> > > > > mostly as a fallback in case MGLRU doesn't work well, our goal is
> > > > > still try to enable MGLRU as much as possible,
> > > >
> > > > Our goals are aligned.
> > > > Before enabling mglru, we must first ensure it won't cause OOM errors
> > > > across multiple servers. We propose fixing this because, during our
> > > > previous mglru enablement, many instances of a single service OOM'd
> > > > simultaneously—potentially leading to data loss for that service.
> > >
> > > Would it be possible to drain the jobs away from the machine before
> > > switching LRUs? The MGLRU kill-switch could be improved, but making
> > > the switch more or less "hitless" would require significant work. Is
> > > the use case a one-time switch from active/inactive to MGLRU?
> >
> > I guess the point is that if upstream provides a sysctl to
> > toggle MGLRU on and off, then that sysctl should actually
> > work as intended. Otherwise, it would be better to remove
> > it.
>
> I think the problem is the requirements are not well specified. :)
We are planning to enable MGLRU across our large server fleet. During
a previous enablement attempt, we observed multiple instances of a
single service experiencing OOM errors simultaneously, which led to
unexpected user data loss. Despite this, we remain committed to
rolling out MGLRU to more production servers, with the critical
requirement of avoiding OOM events during the transition.
Given the scale of our fleet, it is not feasible to enable MGLRU on
servers one by one while continuously monitoring for OOM occurrences.
Therefore, we need to modify the kernel to minimize the risk of OOM
errors during the enablement process.
>
> Is it enough for the knob to function well on idle systems? Or does it
> need to function "ideally" under all conceivable workloads / stress?
> Also how do we define "ideally" - is a stray OOM kill acceptable or
> not? Is that preferable to waiting on the switch / drain to complete
> during reclaim or not? Reasonable users could disagree.
--
Regards
Yafang
next prev parent reply other threads:[~2026-03-03 2:44 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-28 16:10 Leno Hou
2026-02-28 18:58 ` Andrew Morton
2026-02-28 19:12 ` kernel test robot
2026-02-28 19:23 ` kernel test robot
2026-02-28 20:15 ` kernel test robot
2026-02-28 21:28 ` Barry Song
2026-02-28 22:41 ` Barry Song
2026-03-01 4:10 ` Barry Song
2026-03-02 5:50 ` Yafang Shao
2026-03-02 6:58 ` Barry Song
2026-03-02 7:43 ` Yafang Shao
2026-03-02 8:00 ` Kairui Song
2026-03-02 8:15 ` Barry Song
2026-03-02 8:25 ` Yafang Shao
2026-03-02 9:20 ` Barry Song
2026-03-02 9:47 ` Kairui Song
2026-03-02 14:35 ` Yafang Shao
2026-03-02 17:51 ` Yuanchu Xie
2026-03-03 1:34 ` Barry Song
2026-03-03 1:40 ` Axel Rasmussen
2026-03-03 2:43 ` Yafang Shao [this message]
2026-03-02 16:26 ` Michal Hocko
2026-03-02 8:03 ` Barry Song
2026-03-02 8:13 ` Yafang Shao
2026-03-02 8:20 ` Barry Song
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='CALOAHbC0XbvG4OCy94j+ZUyTZt65QB0Y=p1UwKvGcsgcWKy7mg@mail.gmail.com' \
--to=laoar.shao@gmail.com \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=bingfangguo@tencent.com \
--cc=lenohou@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ryncsn@gmail.com \
--cc=weixugc@google.com \
--cc=wjl.linux@gmail.com \
--cc=yuanchu@google.com \
--cc=yuzhao@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