summaryrefslogtreecommitdiffstats
path: root/mm/percpu-vm.c
diff options
context:
space:
mode:
authorDennis Zhou <dennisz@fb.com>2017-06-20 01:28:31 +0200
committerTejun Heo <tj@kernel.org>2017-06-20 21:31:38 +0200
commit30a5b5367ef9d5c9055414e12ec2f02d9de2e70f (patch)
tree900c04966e2adae51b7f833dbedcd8cbe0f828bb /mm/percpu-vm.c
parentpercpu: migrate percpu data structures to internal header (diff)
downloadlinux-30a5b5367ef9d5c9055414e12ec2f02d9de2e70f.tar.xz
linux-30a5b5367ef9d5c9055414e12ec2f02d9de2e70f.zip
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 <dennisz@fb.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'mm/percpu-vm.c')
-rw-r--r--mm/percpu-vm.c5
1 files changed, 5 insertions, 0 deletions
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);