BPF List
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] mm: Select victim memcg using BPF_OOM_POLICY
@ 2023-07-27  7:36 Chuyi Zhou
  2023-07-27  7:36 ` [RFC PATCH 1/5] bpf: Introduce BPF_PROG_TYPE_OOM_POLICY Chuyi Zhou
                   ` (6 more replies)
  0 siblings, 7 replies; 25+ messages in thread
From: Chuyi Zhou @ 2023-07-27  7:36 UTC (permalink / raw)
  To: hannes, mhocko, roman.gushchin, ast, daniel, andrii
  Cc: bpf, linux-kernel, wuyun.abel, robin.lu, Chuyi Zhou

This patchset tries to add a new bpf prog type and use it to select
a victim memcg when global OOM is invoked. The mainly motivation is
the need to customizable OOM victim selection functionality so that
we can protect more important app from OOM killer.

Chuyi Zhou (5):
  bpf: Introduce BPF_PROG_TYPE_OOM_POLICY
  mm: Select victim memcg using bpf prog
  libbpf, bpftool: Support BPF_PROG_TYPE_OOM_POLICY
  bpf: Add a new bpf helper to get cgroup ino
  bpf: Sample BPF program to set oom policy

 include/linux/bpf_oom.h        |  22 ++++
 include/linux/bpf_types.h      |   2 +
 include/linux/memcontrol.h     |   6 ++
 include/uapi/linux/bpf.h       |  21 ++++
 kernel/bpf/core.c              |   1 +
 kernel/bpf/helpers.c           |  17 +++
 kernel/bpf/syscall.c           |  10 ++
 mm/memcontrol.c                |  50 +++++++++
 mm/oom_kill.c                  | 185 +++++++++++++++++++++++++++++++++
 samples/bpf/Makefile           |   3 +
 samples/bpf/oom_kern.c         |  42 ++++++++
 samples/bpf/oom_user.c         | 128 +++++++++++++++++++++++
 tools/bpf/bpftool/common.c     |   1 +
 tools/include/uapi/linux/bpf.h |  21 ++++
 tools/lib/bpf/libbpf.c         |   3 +
 tools/lib/bpf/libbpf_probes.c  |   2 +
 16 files changed, 514 insertions(+)
 create mode 100644 include/linux/bpf_oom.h
 create mode 100644 samples/bpf/oom_kern.c
 create mode 100644 samples/bpf/oom_user.c

-- 
2.20.1


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-08-02  3:05 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-27  7:36 [RFC PATCH 0/5] mm: Select victim memcg using BPF_OOM_POLICY Chuyi Zhou
2023-07-27  7:36 ` [RFC PATCH 1/5] bpf: Introduce BPF_PROG_TYPE_OOM_POLICY Chuyi Zhou
2023-07-27  7:36 ` [RFC PATCH 2/5] mm: Select victim memcg using bpf prog Chuyi Zhou
2023-07-27  7:36 ` [RFC PATCH 3/5] libbpf, bpftool: Support BPF_PROG_TYPE_OOM_POLICY Chuyi Zhou
2023-07-27 12:26   ` Quentin Monnet
2023-07-28  3:01     ` Chuyi Zhou
2023-07-27  7:36 ` [RFC PATCH 4/5] bpf: Add a new bpf helper to get cgroup ino Chuyi Zhou
2023-07-27  7:36 ` [RFC PATCH 5/5] bpf: Sample BPF program to set oom policy Chuyi Zhou
2023-07-27  8:15 ` [RFC PATCH 0/5] mm: Select victim memcg using BPF_OOM_POLICY Michal Hocko
2023-07-27 12:12   ` Chuyi Zhou
2023-07-27 17:23     ` Michal Hocko
2023-07-31  6:00       ` Chuyi Zhou
2023-07-31 13:23         ` Michal Hocko
2023-07-31 16:26           ` Chuyi Zhou
2023-08-01  8:18             ` Michal Hocko
2023-08-02  3:04               ` Chuyi Zhou
2023-07-28  4:30   ` Roman Gushchin
2023-07-28  8:06     ` Michal Hocko
2023-07-28 18:42       ` Roman Gushchin
2023-07-31 13:12         ` Michal Hocko
2023-08-01  6:53     ` Abel Wu
2023-07-27 11:43 ` Alan Maguire
2023-07-27 15:57   ` Alexei Starovoitov
2023-07-27 17:17     ` Michal Hocko
2023-07-28  2:34   ` [External] " Chuyi Zhou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox