Skip to content

Commit a201a96

Browse files
committed
debugobjects: Double the per CPU slots
In situations where objects are rapidly allocated from the pool and handed back, the size of the per CPU pool turns out to be too small. Double the size of the per CPU pool. This reduces the kmem cache allocation and free operations during a kernel compile: alloc free Baseline: 380k 330k Double size: 295k 245k Especially the reduction of allocations is important because that happens in the hot path when objects are initialized. The maximum increase in per CPU pool memory consumption is about 2.5K per online CPU, which is acceptable. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Zhen Lei <thunder.leizhen@huawei.com> Link: https://lore.kernel.org/all/20241007164914.378676302@linutronix.de
1 parent 2638345 commit a201a96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/debugobjects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#define ODEBUG_POOL_SIZE (64 * ODEBUG_BATCH_SIZE)
2929
#define ODEBUG_POOL_MIN_LEVEL (ODEBUG_POOL_SIZE / 4)
3030

31-
#define ODEBUG_POOL_PERCPU_SIZE (4 * ODEBUG_BATCH_SIZE)
31+
#define ODEBUG_POOL_PERCPU_SIZE (8 * ODEBUG_BATCH_SIZE)
3232

3333
#define ODEBUG_CHUNK_SHIFT PAGE_SHIFT
3434
#define ODEBUG_CHUNK_SIZE (1 << ODEBUG_CHUNK_SHIFT)

0 commit comments

Comments
 (0)