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] [day] [month] [year] [list]
Message-ID: <87ldk1mmk3.fsf@linux.dev>
Date: Wed, 19 Nov 2025 19:04:44 -0800
From: Roman Gushchin <roman.gushchin@...ux.dev>
To: Hui Zhu <hui.zhu@...ux.dev>
Cc: Andrew Morton <akpm@...ux-foundation.org>,  Johannes Weiner
 <hannes@...xchg.org>,  Michal Hocko <mhocko@...nel.org>,  Shakeel Butt
 <shakeel.butt@...ux.dev>,  Muchun Song <muchun.song@...ux.dev>,  Alexei
 Starovoitov <ast@...nel.org>,  Daniel Borkmann <daniel@...earbox.net>,
  Andrii Nakryiko <andrii@...nel.org>,  Martin KaFai Lau
 <martin.lau@...ux.dev>,  Eduard Zingerman <eddyz87@...il.com>,  Song Liu
 <song@...nel.org>,  Yonghong Song <yonghong.song@...ux.dev>,  John
 Fastabend <john.fastabend@...il.com>,  KP Singh <kpsingh@...nel.org>,
  Stanislav Fomichev <sdf@...ichev.me>,  Hao Luo <haoluo@...gle.com>,  Jiri
 Olsa <jolsa@...nel.org>,  Shuah Khan <shuah@...nel.org>,  Peter Zijlstra
 <peterz@...radead.org>,  Miguel Ojeda <ojeda@...nel.org>,  Nathan
 Chancellor <nathan@...nel.org>,  Kees Cook <kees@...nel.org>,  Tejun Heo
 <tj@...nel.org>,  Jeff Xu <jeffxu@...omium.org>,  mkoutny@...e.com,  Jan
 Hendrik Farr <kernel@...rr.cc>,  Christian Brauner <brauner@...nel.org>,
  Randy Dunlap <rdunlap@...radead.org>,  Brian Gerst <brgerst@...il.com>,
  Masahiro Yamada <masahiroy@...nel.org>,  linux-kernel@...r.kernel.org,
  linux-mm@...ck.org,  cgroups@...r.kernel.org,  bpf@...r.kernel.org,
  linux-kselftest@...r.kernel.org,  Hui Zhu <zhuhui@...inos.cn>
Subject: Re: [RFC PATCH 0/3] Memory Controller eBPF support

Hui Zhu <hui.zhu@...ux.dev> writes:

> From: Hui Zhu <zhuhui@...inos.cn>
>
> This series proposes adding eBPF support to the Linux memory
> controller, enabling dynamic and extensible memory management
> policies at runtime.
>
> Background
>
> The memory controller (memcg) currently provides fixed memory
> accounting and reclamation policies through static kernel code.
> This limits flexibility for specialized workloads and use cases
> that require custom memory management strategies.
>
> By enabling eBPF programs to hook into key memory control
> operations, administrators can implement custom policies without
> recompiling the kernel, while maintaining the safety guarantees
> provided by the BPF verifier.
>
> Use Cases
>
> 1. Custom memory reclamation strategies for specialized workloads
> 2. Dynamic memory pressure monitoring and telemetry
> 3. Memory accounting adjustments based on runtime conditions
> 4. Integration with container orchestration systems for
>    intelligent resource management
> 5. Research and experimentation with novel memory management
>    algorithms
>
> Design Overview
>
> This series introduces:
>
> 1. A new BPF struct ops type (`memcg_ops`) that allows eBPF
>    programs to implement custom behavior for memory charging
>    operations.
>
> 2. A hook point in the `try_charge_memcg()` fast path that
>    invokes registered eBPF programs to determine if custom
>    memory management should be applied.
>
> 3. The eBPF handler can inspect memory cgroup context and
>    optionally modify certain parameters (e.g., `nr_pages` for
>    reclamation size).
>
> 4. A reference counting mechanism using `percpu_ref` to safely
>    manage the lifecycle of registered eBPF struct ops instances.

Can you please describe how these hooks will be used in practice?
What's the problem you can solve with it and can't without?

I generally agree with an idea to use BPF for various memcg-related
policies, but I'm not sure how specific callbacks can be used in
practice.

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ