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>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user