[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87a514nnty.fsf@linux.dev>
Date: Sun, 02 Nov 2025 13:09:45 -0800
From: Roman Gushchin <roman.gushchin@...ux.dev>
To: Michal Hocko <mhocko@...e.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Alexei Starovoitov <ast@...nel.org>,
Suren Baghdasaryan <surenb@...gle.com>, Shakeel Butt
<shakeel.butt@...ux.dev>, Johannes Weiner <hannes@...xchg.org>, Andrii
Nakryiko <andrii@...nel.org>, JP Kobryn <inwardvessel@...il.com>,
linux-mm@...ck.org, cgroups@...r.kernel.org, bpf@...r.kernel.org,
Martin KaFai Lau <martin.lau@...nel.org>, Song Liu <song@...nel.org>,
Kumar Kartikeya Dwivedi <memxor@...il.com>, Tejun Heo <tj@...nel.org>
Subject: Re: [PATCH v2 07/23] mm: introduce bpf_oom_kill_process() bpf kfunc
Michal Hocko <mhocko@...e.com> writes:
> On Mon 27-10-25 16:17:10, Roman Gushchin wrote:
>> Introduce bpf_oom_kill_process() bpf kfunc, which is supposed
>> to be used by BPF OOM programs. It allows to kill a process
>> in exactly the same way the OOM killer does: using the OOM reaper,
>> bumping corresponding memcg and global statistics, respecting
>> memory.oom.group etc.
>>
>> On success, it sets om_control's bpf_memory_freed field to true,
>> enabling the bpf program to bypass the kernel OOM killer.
>>
>> Signed-off-by: Roman Gushchin <roman.gushchin@...ux.dev>
>
> LGTM
> Just a minor question
>
>> + /* paired with put_task_struct() in oom_kill_process() */
>> + task = tryget_task_struct(task);
>
> Any reason this is not a plain get_task_struct?
Fair enough, get_task_struct() should work too.
Thanks
Powered by blists - more mailing lists