diff options
author | Dennis Zhou <dennisz@fb.com> | 2017-06-20 01:28:31 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2017-06-20 21:31:38 +0200 |
commit | 30a5b5367ef9d5c9055414e12ec2f02d9de2e70f (patch) | |
tree | 900c04966e2adae51b7f833dbedcd8cbe0f828bb /mm/percpu-km.c | |
parent | percpu: migrate percpu data structures to internal header (diff) | |
download | linux-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-km.c')
-rw-r--r-- | mm/percpu-km.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/percpu-km.c b/mm/percpu-km.c index d66911ff42d9..3bbfa0c9d069 100644 --- a/mm/percpu-km.c +++ b/mm/percpu-km.c @@ -72,6 +72,8 @@ static struct pcpu_chunk *pcpu_create_chunk(void) pcpu_chunk_populated(chunk, 0, nr_pages); spin_unlock_irq(&pcpu_lock); + pcpu_stats_chunk_alloc(); + return chunk; } @@ -79,6 +81,8 @@ static void pcpu_destroy_chunk(struct pcpu_chunk *chunk) { const int nr_pages = pcpu_group_sizes[0] >> PAGE_SHIFT; + pcpu_stats_chunk_dealloc(); + if (chunk && chunk->data) __free_pages(chunk->data, order_base_2(nr_pages)); pcpu_free_chunk(chunk); |