[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87ms7c5sw4.fsf@linux.dev>
Date: Tue, 02 Sep 2025 16:36:27 -0700
From: Roman Gushchin <roman.gushchin@...ux.dev>
To: Martin KaFai Lau <martin.lau@...ux.dev>
Cc: 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>, Song Liu <song@...nel.org>, 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
Martin KaFai Lau <martin.lau@...ux.dev> writes:
> On 9/2/25 10:31 AM, Roman Gushchin wrote:
>> Btw, what's the right way to attach struct ops to a cgroup, if there is
>> one? Add a cgroup_id field to the struct and use it in the .reg()
>
> Adding a cgroup id/fd field to the struct bpf_oom_ops will be hard to
> attach the same bpf_oom_ops to multiple cgroups.
Yeah, this is what I thought too, it doesn't look as an attractive path.
>
>> callback? Or there is something better?
>
> There is a link_create.target_fd in the "union bpf_attr". The
> cgroup_bpf_link_attach() is using it as cgroup fd. May be it can be
> used here also. This will limit it to link attach only. Meaning the
> SEC(".struct_ops.link") is supported but not the older
> SEC(".struct_ops"). I think this should be fine.
I'll take a look, thank you!
Powered by blists - more mailing lists