Re: [PATCH 1/2] perf core: Add a kmem_cache for struct perf_event

2021-03-11 Thread Peter Zijlstra
On Thu, Mar 11, 2021 at 08:54:12PM +0900, Namhyung Kim wrote: > From: Namhyung Kim > > The kernel can allocate a lot of struct perf_event when profiling. For > example, 256 cpu x 8 events x 20 cgroups = 40K instances of the struct > would be allocated on a large system. > > The size of struct pe

[PATCH 1/2] perf core: Add a kmem_cache for struct perf_event

2021-03-11 Thread Namhyung Kim
From: Namhyung Kim The kernel can allocate a lot of struct perf_event when profiling. For example, 256 cpu x 8 events x 20 cgroups = 40K instances of the struct would be allocated on a large system. The size of struct perf_event in my setup is 1152 byte. As it's allocated by kmalloc, the actual