Re: [PATCH 3/4] percpu: expose statistics about percpu memory via debugfs

From: Geert Uytterhoeven
Date: Fri Jul 07 2017 - 04:16:10 EST


Hi Dennis,

On Tue, Jun 20, 2017 at 1:28 AM, Dennis Zhou <dennisz@xxxxxx> wrote:
> There is limited visibility into the use of percpu memory leaving us
> unable to reason about correctness of parameters and overall use of
> percpu memory. These counters and statistics aim to help understand
> basic statistics about percpu memory such as number of allocations over
> the lifetime, allocation sizes, and fragmentation.
>
> New Config: PERCPU_STATS
>
> Signed-off-by: Dennis Zhou <dennisz@xxxxxx>
> ---
> mm/Kconfig | 8 ++
> mm/Makefile | 1 +
> mm/percpu-internal.h | 131 ++++++++++++++++++++++++++++++
> mm/percpu-km.c | 4 +
> mm/percpu-stats.c | 222 +++++++++++++++++++++++++++++++++++++++++++++++++++
> mm/percpu-vm.c | 5 ++
> mm/percpu.c | 9 +++
> 7 files changed, 380 insertions(+)
> create mode 100644 mm/percpu-stats.c
>
> diff --git a/mm/Kconfig b/mm/Kconfig
> index beb7a45..8fae426 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -706,3 +706,11 @@ config ARCH_USES_HIGH_VMA_FLAGS
> bool
> config ARCH_HAS_PKEYS
> bool
> +
> +config PERCPU_STATS
> + bool "Collect percpu memory statistics"
> + default n
> + help
> + This feature collects and exposes statistics via debugfs. The
> + information includes global and per chunk statistics, which can
> + be used to help understand percpu memory usage.

Just wondering: does this option make sense to enable on !SMP?

If not, you may want to make it depend on SMP.

Thanks!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds