This series use the hierarchical tree counter approximation (hpcc) to:
* Increase accuracy of approximated RSS counters exposed through proc
interfaces:
With a test program hopping across CPUs doing frequent mmap/munmap
operations, the upstream implementation approximation reaches a 1GB
delta from the precise value after a few minutes, compared to a 80MB
delta with the hierarchical counter. The hierarchical counter provides a
guaranteed maximum approximation inaccuracy of 192MB on that hardware
topology.
* Implement the OOM killer task selection with a 2-pass algorithm. This
is a latency reduction improvement of the OOM killer task selection:
Testing the execution time of select_bad_process() with a single
tail -f /dev/zero:
AMD EPYC 9654 96-Core (2 sockets)
Within a KVM, configured with 256 logical cpus.
| precise sum | hpcc |
----------------------------------|-------------|----------|
nr_processes=40 | 0.5 ms | 0.3 ms |
nr_processes=10000 | 80.0 ms | 7.9 ms |
I'm sending this series to gather feedback. I plan to re-submit it for
inclusion into mm-new _after_ the next merge window closes, so the bug
fix "mm: Fix OOM killer inaccuracy on large many-core systems" can be
tested in the current release cycle.
Andrew, if you have a prior version of this specific series in mm-new,
please drop it for now.
This series is based on v6.19-rc4, on top of the following three
preparation series:
https://lore.kernel.org/linux-mm/[email protected]/T/#t
https://lore.kernel.org/linux-mm/[email protected]/T/#t
https://lore.kernel.org/linux-mm/[email protected]/
Thanks,
Mathieu
Cc: Andrew Morton <[email protected]>
Cc: "Paul E. McKenney" <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Dennis Zhou <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Martin Liu <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: [email protected]
Cc: Shakeel Butt <[email protected]>
Cc: SeongJae Park <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Sweet Tea Dorminy <[email protected]>
Cc: Lorenzo Stoakes <[email protected]>
Cc: "Liam R . Howlett" <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Suren Baghdasaryan <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Christian Brauner <[email protected]>
Cc: Wei Yang <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Miaohe Lin <[email protected]>
Cc: Al Viro <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Yu Zhao <[email protected]>
Cc: Roman Gushchin <[email protected]>
Cc: Mateusz Guzik <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Baolin Wang <[email protected]>
Cc: Aboorva Devarajan <[email protected]>
Mathieu Desnoyers (3):
lib: Introduce hierarchical per-cpu counters
mm: Improve RSS counter approximation accuracy for proc interfaces
mm: Reduce latency of OOM killer task selection with 2-pass algorithm
.../core-api/percpu-counter-tree.rst | 75 ++
fs/proc/base.c | 2 +-
include/linux/mm.h | 49 +-
include/linux/mm_types.h | 54 +-
include/linux/oom.h | 11 +-
include/linux/percpu_counter_tree.h | 367 ++++++++++
include/trace/events/kmem.h | 2 +-
init/main.c | 2 +
kernel/fork.c | 22 +-
lib/Makefile | 1 +
lib/percpu_counter_tree.c | 679 ++++++++++++++++++
mm/oom_kill.c | 84 ++-
12 files changed, 1295 insertions(+), 53 deletions(-)
create mode 100644 Documentation/core-api/percpu-counter-tree.rst
create mode 100644 include/linux/percpu_counter_tree.h
create mode 100644 lib/percpu_counter_tree.c
--
2.39.5