diff --git a/core/hakmem_tiny_superslab_constants.h b/core/hakmem_tiny_superslab_constants.h index 6155badc..603350a3 100644 --- a/core/hakmem_tiny_superslab_constants.h +++ b/core/hakmem_tiny_superslab_constants.h @@ -9,18 +9,27 @@ // SuperSlab Layout Constants // ============================================================================ -// Log2 range for SuperSlab sizes (in MB): -// - MIN: 1MB (2^20) -// - MAX: 2MB (2^21) -// - DEFAULT: 2MB unless constrained by ACE/env +// Log2 range for SuperSlab sizes: +// - MIN: 512KB (2^19) - Phase 2 optimization: reduced from 1MB +// - MAX: 2MB (2^21) - unchanged +// - DEFAULT: 512KB (2^19) - Phase 2 optimization: reduced from 2MB +// +// Phase 2-Opt2: Reduce SuperSlab size to minimize initialization cost +// Benefit: 75% reduction in allocation size (2MB → 512KB) +// Expected: +3-5% throughput improvement +// Rationale: +// - Smaller SuperSlab = fewer page faults during allocation +// - Better memory granularity (less wasted VA space) +// - Memset already removed in Phase 1, so pure allocation overhead +// - Perf analysis showed shared_pool_acquire_slab at 23.83% CPU time #ifndef SUPERSLAB_LG_MIN -#define SUPERSLAB_LG_MIN 20 +#define SUPERSLAB_LG_MIN 19 #endif #ifndef SUPERSLAB_LG_MAX #define SUPERSLAB_LG_MAX 21 #endif #ifndef SUPERSLAB_LG_DEFAULT -#define SUPERSLAB_LG_DEFAULT 21 +#define SUPERSLAB_LG_DEFAULT 19 #endif // Size of each slab within SuperSlab (fixed, never changes)