From 30a5b5367ef9d5c9055414e12ec2f02d9de2e70f Mon Sep 17 00:00:00 2001 From: Dennis Zhou Date: Mon, 19 Jun 2017 19:28:31 -0400 Subject: percpu: expose statistics about percpu memory via debugfs 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 Signed-off-by: Tejun Heo --- mm/percpu-vm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mm/percpu-vm.c') diff --git a/mm/percpu-vm.c b/mm/percpu-vm.c index 9ac639499bd1..5915a224da52 100644 --- a/mm/percpu-vm.c +++ b/mm/percpu-vm.c @@ -343,11 +343,16 @@ static struct pcpu_chunk *pcpu_create_chunk(void) chunk->data = vms; chunk->base_addr = vms[0]->addr - pcpu_group_offsets[0]; + + pcpu_stats_chunk_alloc(); + return chunk; } static void pcpu_destroy_chunk(struct pcpu_chunk *chunk) { + pcpu_stats_chunk_dealloc(); + if (chunk && chunk->data) pcpu_free_vm_areas(chunk->data, pcpu_nr_groups); pcpu_free_chunk(chunk); -- cgit v1.2.3-55-g7522