lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHzjS_tq34QC4NDQd_L8crQii2QZCxZr28ywSw=gMnFnqD_z2A@mail.gmail.com>
Date: Wed, 8 Oct 2025 00:03:37 -0700
From: Song Liu <liu.song.linuxdev@...il.com>
To: Roman Gushchin <roman.gushchin@...ux.dev>
Cc: Song Liu <song@...nel.org>, Andrii Nakryiko <andrii.nakryiko@...il.com>, 
	Martin KaFai Lau <martin.lau@...ux.dev>, Alexei Starovoitov <alexei.starovoitov@...il.com>, 
	Kumar Kartikeya Dwivedi <memxor@...il.com>, linux-mm <linux-mm@...ck.org>, bpf <bpf@...r.kernel.org>, 
	Suren Baghdasaryan <surenb@...gle.com>, Johannes Weiner <hannes@...xchg.org>, Michal Hocko <mhocko@...e.com>, 
	David Rientjes <rientjes@...gle.com>, Matt Bobrowski <mattbobrowski@...gle.com>, 
	Alexei Starovoitov <ast@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>, 
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 01/14] mm: introduce bpf struct ops for OOM handling

On Tue, Oct 7, 2025 at 7:15 PM Roman Gushchin <roman.gushchin@...ux.dev> wrote:
[...]
> >
> > I am not sure what is the best option for cgroup oom killer. There
> > are multiple options. Technically, it can even be a sysfs entry.
> > We can use it as:
> >
> > # load and pin oom killers first
> > $ cat /sys/fs/cgroup/user.slice/oom.killer
> > [oom_a] oom_b oom_c
> > $ echo oom_b > /sys/fs/cgroup/user.slice/oom.killer
> > $ cat /sys/fs/cgroup/user.slice/oom.killer
> > oom_a [oom_b] oom_c
>
> It actually looks nice!
> But I expect that most users of bpf_oom won't use it directly,
> but through some sort of middleware (e.g. systemd), so Idk if
> such a user-oriented interface makes a lot of sense.
>
> > Note that, I am not proposing to use sysfs entries for oom killer.
> > I just want to say it is an option.
> >
> > Given attach() can be implemented in different ways, we probably
> > don't need to add it to bpf_struct_ops. But if that turns out to be
> > the best option, I would not argue against it. OTOH, I think it is
> > better to keep reg() and attach() separate, though sched_ext is
> > using reg() for both options.
>
> I'm inclining towards a similar approach, except that I don't want
> to embed cgroup_id into the struct_ops, but keep it in the link,
> as Martin suggested. But I need to implement it end-to-end before I can
> be sure that it's the best option. Working on it...

If we add cgroup_id to the link, I guess this means we need the link
(some fd in user space) to hold reference on the attachment of this
oom struct_ops on this is cgroup. Do we also need this link to hold
a reference on the cgroup?

Alternatively, we can have the cgroup hold a reference to this
struct_ops. This way, we don't need a link to hold reference to the
struct_ops. I think this might be a cleaner design.

Just an idea. If this doesn't make sense, we can revisit this with
the code.

Thanks,
Song

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ