linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] alloc_tag: add per-numa node stats
@ 2025-05-30  0:39 Casey Chen
  2025-05-30  0:39 ` [PATCH] " Casey Chen
  2025-05-30  1:11 ` [PATCH 0/1] " Kent Overstreet
  0 siblings, 2 replies; 20+ messages in thread
From: Casey Chen @ 2025-05-30  0:39 UTC (permalink / raw)
  To: linux-mm, surenb, kent.overstreet; +Cc: yzhong, cachen

The patch is based 4aab42ee1e4e ("mm/zblock: make active_list rcu_list")
from branch mm-new of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

The patch adds per-NUMA alloc_tag stats. Bytes/calls in total and per-NUMA
nodes are displayed in a single row for each alloc_tag in /proc/allocinfo.
Also percpu allocation is marked and its stats is stored on NUMA node 0.
For example, the resulting file looks like below.

percpu y total         8588     2147 numa0         8588     2147 numa1            0        0 kernel/irq/irqdesc.c:425 func:alloc_desc
percpu n total       447232     1747 numa0       269568     1053 numa1       177664      694 lib/maple_tree.c:165 func:mt_alloc_bulk
percpu n total        83200      325 numa0        30976      121 numa1        52224      204 lib/maple_tree.c:160 func:mt_alloc_one
...
percpu n total       364800     5700 numa0       109440     1710 numa1       255360     3990 drivers/net/ethernet/mellanox/mlx5/core/cmd.c:1410 [mlx5_core] func:mlx5_alloc_cmd_msg
percpu n total      1249280    39040 numa0       374784    11712 numa1       874496    27328 drivers/net/ethernet/mellanox/mlx5/core/cmd.c:1376 [mlx5_core] func:alloc_cmd_box

To save memory, we dynamically allocate per-NUMA node stats counter once the
system boots up and knows how many NUMA nodes available. percpu allocators
are used for memory allocation hence increase PERCPU_DYNAMIC_RESERVE.

For in-kernel alloc_tags, pcpu_alloc_noprof() is called so the memory for
these counters are not accounted in profiling stats.

For loadable modules, __alloc_percpu_gfp() is called and memory is accounted.

percpu y total        17024      532 numa0        17024      532 numa1            0        0 lib/alloc_tag.c:564 func:load_module

Casey Chen (1):
  alloc_tag: add per-numa node stats

 include/linux/alloc_tag.h | 48 +++++++++++++++++++++++++++------------
 include/linux/codetag.h   |  4 ++++
 include/linux/percpu.h    |  2 +-
 lib/alloc_tag.c           | 41 +++++++++++++++++++++++++++------
 mm/page_alloc.c           | 35 ++++++++++++++--------------
 mm/percpu.c               |  8 +++++--
 mm/show_mem.c             | 21 ++++++++++++-----
 mm/slub.c                 | 10 +++++---
 8 files changed, 119 insertions(+), 50 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2025-06-10 15:56 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-30  0:39 [PATCH 0/1] alloc_tag: add per-numa node stats Casey Chen
2025-05-30  0:39 ` [PATCH] " Casey Chen
2025-05-30  1:11 ` [PATCH 0/1] " Kent Overstreet
2025-05-30 21:45   ` Casey Chen
2025-05-31  0:05     ` Kent Overstreet
2025-06-02 20:48       ` Casey Chen
2025-06-02 21:32         ` Suren Baghdasaryan
2025-06-03 15:00           ` Suren Baghdasaryan
2025-06-03 17:34             ` Kent Overstreet
2025-06-04  0:55             ` Casey Chen
2025-06-04 15:21               ` Suren Baghdasaryan
2025-06-04 15:50                 ` Kent Overstreet
2025-06-10  0:21                 ` Casey Chen
2025-06-10 15:56                   ` Suren Baghdasaryan
2025-06-03 20:00           ` Casey Chen
2025-06-03 20:18             ` Suren Baghdasaryan
2025-06-02 21:52         ` Kent Overstreet
2025-06-02 22:08           ` Steven Rostedt
2025-06-02 23:35             ` Kent Overstreet
2025-06-03  6:46               ` Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).