From: Shakeel Butt <shakeel.butt@linux.dev>
To: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Alexei Starovoitov <ast@kernel.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
JP Kobryn <jp.kobryn@linux.dev>,
Muchun Song <muchun.song@linux.dev>,
Michal Koutny <mkoutny@suse.com>,
Amery Hung <ameryhung@gmail.com>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
Emil Tsalapatis <emil@etsalapatis.com>,
Jiri Olsa <jolsa@kernel.org>,
Ihor Solodrai <ihor.solodrai@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
Jiayuan Chen <jiayuan.chen@linux.dev>,
hui.zhu@linux.dev, Donet Tom <donettom@linux.ibm.com>,
Greg Thelen <gthelen@google.com>,
Meta kernel team <kernel-team@meta.com>,
linux-mm@kvack.org, bpf@vger.kernel.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/4] memcg_ext: memcg policy through cgroup-attached struct_ops
Date: Wed, 30 Sep 2026 18:00:41 -0700 [thread overview]
Message-ID: <ar2kvmCPR9q31V8M@linux.dev> (raw)
In-Reply-To: <bc6815954b8d08e75deadd43e1a2192c@kernel.org>
On Wed, Sep 30, 2026 at 01:35:33PM -1000, Tejun Heo wrote:
> Hello, Shakeel.
>
> On Wed, Sep 30, 2026 at 06:28:21AM -0700, Shakeel Butt wrote:
> > I am fine with changing the default behavior. Actually, I have been
> > contemplating whether I should propose a revert of commit c9afe31ec443e
> > ("memcg: synchronously enforce memory.high for large overcharges") because
> > it has introduced more problems than it has solved, but that is a separate
> > topic. The initial commit already mentioned that MEMCG_CHARGE_BATCH was used
> > arbitrarily, so replacing it with something big might be acceptable. I want
> > to keep that decision separate.
>
> Which kernel paths allocate enough for this to matter? Can you give specific
> examples where the in-kernel synchronous enforcement helps?
mlock(), madvise(POPULATE), fadvise(WILLNEED) are the obvious ones where large
amount of memory can be allocated before returning to userspace. Now regarding
the in-kernel sync high enforcement for these cases helps or not, I think it
depends on what the user is trying to achieve with memory.high. One scenario I
can think of is an overcommitted system where admin dynamically adjusts
memory.high limits of colocated workloads based on their working set size. The
memory spikes will be smoothen by memory.high otherwise colocated workload can
be negatively impact. In this example, ineffective memory.high will not be able
to avoid global pressure which can impact colocated workloads.
BTW the above scenario is just an example and not something I am proposing.
Actually I think memory overcommit in the presense sync throttling can
potentially cause more isolation issues.
>
> > Returning to the actual proposal, my plan was to start small with a narrow,
> > specific use case. However, my long-term plan is to provide a mechanism to
> > change the default behavior for custom use cases. For example, for
> > memory.high, I will provide a way for users to specify what behavior they
> > want, i.e., whether or not they want more synchronous throttling.
>
> This doesn't seem like a policy problem.
What is "This" in the above statement?
> It feels like a problem that should
> be and can reasonably be solved for everybody, so I'm not sure whether BPF is
> the right call for this specific purpose.
Here if you meant that default behavior of memory.high should work for most (if
not all) users then we are on same page. If some user want memory.high reclaim
to happen in a separate thread instead of return-to-userspace or synchronously,
this proposal provides mechanism through BPF to such users to achieve their
goals.
prev parent reply other threads:[~2026-10-01 1:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 19:25 Shakeel Butt
2026-09-21 19:25 ` [RFC PATCH 1/4] bpf, cgroup: fix cgroup struct_ops query for a second attach type Shakeel Butt
2026-09-21 20:19 ` bot+bpf-ci
2026-09-29 11:49 ` Yafang Shao
2026-09-21 19:25 ` [RFC PATCH 2/4] memcg_ext: add cgroup-attached bpf_memcg_ops Shakeel Butt
2026-09-21 19:25 ` [RFC PATCH 3/4] memcg_ext: allow BPF to defer memory.high enforcement Shakeel Butt
2026-09-24 20:14 ` JP Kobryn
2026-09-24 21:19 ` Shakeel Butt
2026-09-21 19:25 ` [RFC PATCH 4/4] selftests/bpf: add a cgroupfs lock-holder bpf_memcg_ops sample Shakeel Butt
2026-09-23 13:07 ` [RFC PATCH 0/4] memcg_ext: memcg policy through cgroup-attached struct_ops Yafang Shao
2026-09-23 15:47 ` Shakeel Butt
2026-09-24 10:01 ` Yafang Shao
2026-09-24 20:42 ` Shakeel Butt
2026-09-28 3:23 ` Yafang Shao
2026-09-28 20:40 ` Tejun Heo
2026-09-30 13:28 ` Shakeel Butt
2026-09-30 23:35 ` Tejun Heo
2026-10-01 1:00 ` Shakeel Butt [this message]
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=ar2kvmCPR9q31V8M@linux.dev \
--to=shakeel.butt@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=ameryhung@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=donettom@linux.ibm.com \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=gthelen@google.com \
--cc=hannes@cmpxchg.org \
--cc=hui.zhu@linux.dev \
--cc=ihor.solodrai@linux.dev \
--cc=jiayuan.chen@linux.dev \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=jp.kobryn@linux.dev \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=mhocko@kernel.org \
--cc=mkoutny@suse.com \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=song@kernel.org \
--cc=tj@kernel.org \
--cc=yonghong.song@linux.dev \
/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
all inboxes | Powered by JetHome®