Re: [PATCH v9 1/2] lib: Introduce hierarchical per-cpu counters
From: Andrew Morton
Date: Sat Nov 22 2025 - 14:13:38 EST
On Sat, 22 Nov 2025 12:15:02 -0500 Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx> wrote:
> >
> >> include/linux/percpu_counter_tree.h | 239 +++++++++++++++
> >> init/main.c | 2 +
> >> lib/Makefile | 1 +
> >> lib/percpu_counter_tree.c | 443 ++++++++++++++++++++++++++++
> >> 4 files changed, 685 insertions(+)
> >> create mode 100644 include/linux/percpu_counter_tree.h
> >> create mode 100644 lib/percpu_counter_tree.c
> >
> > An in-kernel test suite would be great. Like lib/*test*.c or
> > tools/testing/.
>
> I'll keep a note to port the tests from my userspace librseq
> percpu counters feature branch to the kernel. I did not do it
> initially because I wanted to see if the overall approach was
> deemed interesting for the kernel.
It deems interesting to me - certainly seems useful in addressing some
nasty problems.
If it hasn't been massacred by reviewers, please poke me in a week or
so and I'll look at giving it some exposure in mm.git's mm-new branch
(which isn't included in linux-next).