[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260114145915.49926-1-mathieu.desnoyers@efficios.com>
Date: Wed, 14 Jan 2026 09:59:12 -0500
From: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Dennis Zhou <dennis@...nel.org>,
Tejun Heo <tj@...nel.org>,
Christoph Lameter <cl@...ux.com>,
Martin Liu <liumartin@...gle.com>,
David Rientjes <rientjes@...gle.com>,
christian.koenig@....com,
Shakeel Butt <shakeel.butt@...ux.dev>,
SeongJae Park <sj@...nel.org>,
Michal Hocko <mhocko@...e.com>,
Johannes Weiner <hannes@...xchg.org>,
Sweet Tea Dorminy <sweettea-kernel@...miny.me>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
"Liam R . Howlett" <liam.howlett@...cle.com>,
Mike Rapoport <rppt@...nel.org>,
Suren Baghdasaryan <surenb@...gle.com>,
Vlastimil Babka <vbabka@...e.cz>,
Christian Brauner <brauner@...nel.org>,
Wei Yang <richard.weiyang@...il.com>,
David Hildenbrand <david@...hat.com>,
Miaohe Lin <linmiaohe@...wei.com>,
Al Viro <viro@...iv.linux.org.uk>,
linux-mm@...ck.org,
linux-trace-kernel@...r.kernel.org,
Yu Zhao <yuzhao@...gle.com>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Mateusz Guzik <mjguzik@...il.com>,
Matthew Wilcox <willy@...radead.org>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
Aboorva Devarajan <aboorvad@...ux.ibm.com>
Subject: [PATCH v16 0/3] Improve proc RSS accuracy and OOM killer latency
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/20251224173358.647691-1-mathieu.desnoyers@efficios.com/T/#t
https://lore.kernel.org/linux-mm/20251224173810.648699-1-mathieu.desnoyers@efficios.com/T/#t
https://lore.kernel.org/linux-mm/20260114143642.47333-1-mathieu.desnoyers@efficios.com/
Thanks,
Mathieu
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: "Paul E. McKenney" <paulmck@...nel.org>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc: Dennis Zhou <dennis@...nel.org>
Cc: Tejun Heo <tj@...nel.org>
Cc: Christoph Lameter <cl@...ux.com>
Cc: Martin Liu <liumartin@...gle.com>
Cc: David Rientjes <rientjes@...gle.com>
Cc: christian.koenig@....com
Cc: Shakeel Butt <shakeel.butt@...ux.dev>
Cc: SeongJae Park <sj@...nel.org>
Cc: Michal Hocko <mhocko@...e.com>
Cc: Johannes Weiner <hannes@...xchg.org>
Cc: Sweet Tea Dorminy <sweettea-kernel@...miny.me>
Cc: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Cc: "Liam R . Howlett" <liam.howlett@...cle.com>
Cc: Mike Rapoport <rppt@...nel.org>
Cc: Suren Baghdasaryan <surenb@...gle.com>
Cc: Vlastimil Babka <vbabka@...e.cz>
Cc: Christian Brauner <brauner@...nel.org>
Cc: Wei Yang <richard.weiyang@...il.com>
Cc: David Hildenbrand <david@...hat.com>
Cc: Miaohe Lin <linmiaohe@...wei.com>
Cc: Al Viro <viro@...iv.linux.org.uk>
Cc: linux-mm@...ck.org
Cc: linux-trace-kernel@...r.kernel.org
Cc: Yu Zhao <yuzhao@...gle.com>
Cc: Roman Gushchin <roman.gushchin@...ux.dev>
Cc: Mateusz Guzik <mjguzik@...il.com>
Cc: Matthew Wilcox <willy@...radead.org>
Cc: Baolin Wang <baolin.wang@...ux.alibaba.com>
Cc: Aboorva Devarajan <aboorvad@...ux.ibm.com>
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
Powered by blists - more mailing lists