Re: [PATCH v20 0/6] Hierarchical Percpu Counters for RSS

From: Mathieu Desnoyers

Date: Wed Aug 05 2026 - 14:37:24 EST


On 2026-07-23 13:53, Mathieu Desnoyers wrote:
On 2026-07-07 09:15, Mathieu Desnoyers wrote:
Hi Andrew,

Here is the hierarchical percpu counters series rebased on top of
v7.2-rc2. It includes small bootup fixes which were needed to fix
bootup sequence on specific architectures, and a rename of the
test config option to include "KUNIT_".

This aims at replacing the prior version of the series you had
in mm.

As a reminder, the goal here is to provide more precise RSS counters
through /proc.

Hello,

Just a gentle ping for feedback whenever it's convenient.

Hi Andrew,

Can you pick this up after the upcoming merge window ?

That's of course assuming this is solving an issue which is
still relevant.

If there is no interest in solving this issue anymore, kindly
let me know and I'll drop this series.

Thanks,

Mathieu


Thanks,

Mathieu


Thanks,

Mathieu

Mathieu Desnoyers (6):
   lib: introduce hierarchical per-cpu counters
   lib: test hierarchical per-cpu counters
   mm: improve RSS counter approximation accuracy for proc interfaces
   mm: reorder mm_struct flexible array to place mm_cpumask first
   init: move percpu_counter_tree_subsystem_init() earlier in boot
   lib: inline percpu_counter_tree_items_size with boot-safety sentinel

Cc: "Paul E. McKenney" <paulmck@xxxxxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
Cc: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
Cc: Dennis Zhou <dennis@xxxxxxxxxx>
Cc: Tejun Heo <tj@xxxxxxxxxx>
Cc: Christoph Lameter <cl@xxxxxxxxx>
Cc: Martin Liu <liumartin@xxxxxxxxxx>
Cc: David Rientjes <rientjes@xxxxxxxxxx>
Cc: christian.koenig@xxxxxxx
Cc: Shakeel Butt <shakeel.butt@xxxxxxxxx>
Cc: SeongJae Park <sj@xxxxxxxxxx>
Cc: Michal Hocko <mhocko@xxxxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: Sweet Tea Dorminy <sweettea-kernel@xxxxxxxxxx>
Cc: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
Cc: "Liam R . Howlett" <liam.howlett@xxxxxxxxxx>
Cc: Mike Rapoport <rppt@xxxxxxxxxx>
Cc: Suren Baghdasaryan <surenb@xxxxxxxxxx>
Cc: Vlastimil Babka <vbabka@xxxxxxx>
Cc: Christian Brauner <brauner@xxxxxxxxxx>
Cc: Wei Yang <richard.weiyang@xxxxxxxxx>
Cc: David Hildenbrand <david@xxxxxxxxxx>
Cc: Miaohe Lin <linmiaohe@xxxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Yu Zhao <yuzhao@xxxxxxxxxx>
Cc: Roman Gushchin <roman.gushchin@xxxxxxxxx>
Cc: Mateusz Guzik <mjguzik@xxxxxxxxx>
Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx>
Cc: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>
Cc: Aboorva Devarajan <aboorvad@xxxxxxxxxxxxx>
Cc: David Carlier <devnexen@xxxxxxxxx>
Cc: Josh Law <objecting@xxxxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>

  .../core-api/percpu-counter-tree.rst          |  75 ++
  include/linux/mm.h                            |  20 +-
  include/linux/mm_types.h                      |  65 +-
  include/linux/percpu_counter_tree.h           | 387 ++++++++++
  include/trace/events/kmem.h                   |   2 +-
  init/main.c                                   |   2 +
  kernel/fork.c                                 |  24 +-
  lib/Kconfig                                   |  12 +
  lib/Makefile                                  |   1 +
  lib/percpu_counter_tree.c                     | 694 ++++++++++++++++++
  lib/tests/Makefile                            |   2 +
  lib/tests/percpu_counter_tree_kunit.c         | 399 ++++++++++
  12 files changed, 1651 insertions(+), 32 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
  create mode 100644 lib/tests/percpu_counter_tree_kunit.c





--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com