Re: [PATCH bpf-next v4 00/17] mm: BPF OOM

From: Ben Gardon

Date: Thu Dec 03 2026 - 13:17:04 EST


On Wed, Dec 2, 2026 at 5:24 PM Alexei Starovoitov
<alexei.starovoitov@xxxxxxxxx> wrote:
>
> On Wed, Dec 02, 2026 at 01:03 PM Ben Gardon <bgardon@xxxxxxxxxx> wrote:
> > - Patch 11: A systemd-oomd style BPF OOM policy example and selftest.
>
> In v3 we agreed on a production ready policy that users can enable
> without clang and kernel sources. Roman agreed in for v4:
> https://lore.kernel.org/bpf/87zf5x1tqx.fsf@xxxxxxxxx/
> but this v4 still doesn't have it.

Ah, my apologies, I missed the commitment to the policy being ready to
load without clang or src. If the systemd-oomd example is acceptable
for that purpose, I will figure out how to make it easily loadable.

Otherwise, the first application of the policy we have at Google is
proactively terminating processes at a global free memory watermark,
above the OOM threshold. We use this to prevent low priority batch
jobs from affecting other jobs. If that would be preferable, I can
include that instead of the systemd-oomd implementation and make it
auto-loadable.

Please let me know which you prefer and, if you prefer systemd oomd,
any feedback on it.

>
> On bpf infra side we added support for struct-ops in lskel.
> So there are no blockers to have builtin bpf_oom policy in vmlinux binary
> that just works out of the box.
> The user should be able to load a different one, of course. Ideally signed bpf.
>
> pw-bot: cr