Re: [RFC PATCH 0/3] Memory Controller eBPF support

From: hui . zhu

Date: Thu Nov 27 2025 - 03:51:35 EST


2025年11月27日 00:01, "Michal Hocko" <mhocko@xxxxxxxx mailto:mhocko@xxxxxxxx?to=%22Michal%20Hocko%22%20%3Cmhocko%40suse.com%3E > 写到:


>
> On Wed 26-11-25 03:05:32, hui.zhu@xxxxxxxxx wrote:
>
> >
> > 2025年11月25日 20:55, "Michal Hocko" <mhocko@xxxxxxxx mailto:mhocko@xxxxxxxx?to=%22Michal%20Hocko%22%20%3Cmhocko%40suse.com%3E > 写到:
> >
> >
> >
> > On Tue 25-11-25 12:39:11, hui.zhu@xxxxxxxxx wrote:
> >
> > >
> > > My goal is implement dynamic memory reclamation for memcgs without limits,
> > > triggered by specific conditions.
> > >
> > > For instance, with memcg A and memcg B both unlimited, when memcg A faces
> > > high PSI pressure, ebpf control memcg B do some memory reclaim work when
> > > it try charge.
> > >
> > Understood. Please also think whether this is already possible with
> > existing interfaces and if not what are roadblocks in that direction.
> >
> > I think it's possible to implement a userspace program using the existing
> > PSI userspace interfaces and the control interfaces provided by memcg to
> > accomplish this task.
> > However, this approach has several limitations:
> > the entire process depends on the continuous execution of the userspace
> > program, response latency is higher, and we cannot perform fine-grained
> > operations on target memcg.
> >
> I will need to back these arguments by some actual numbers.

Agree – I’ll implement a PoC show it.

Best,
Hui

>
> >
> > Now that Roman has provided PSI eBPF functionality at
> > https://lore.kernel.org/lkml/20251027231727.472628-1-roman.gushchin@xxxxxxxxx/
> > Maybe we could add eBPF support to memcg as well, allowing us to implement
> > the entire functionality directly in the kernel through eBPF.
> >
> His usecase is very specific to OOM handling and we have agreed that
> this specific usecase is really tricky to achieve from userspace. I
> haven't see sound arguments for this usecase yet.
> --
> Michal Hocko
> SUSE Labs
>