Moe Charm (CI)
03df05ec75
Phase 12: Shared SuperSlab Pool implementation (WIP - runtime crash)
## Summary
Implemented Phase 12 Shared SuperSlab Pool (mimalloc-style) to address
SuperSlab allocation churn (877 SuperSlabs → 100-200 target).
## Implementation (ChatGPT + Claude)
1. **Metadata changes** (superslab_types.h):
- Added class_idx to TinySlabMeta (per-slab dynamic class)
- Removed size_class from SuperSlab (no longer per-SuperSlab)
- Changed owner_tid (16-bit) → owner_tid_low (8-bit)
2. **Shared Pool** (hakmem_shared_pool.{h,c}):
- Global pool shared by all size classes
- shared_pool_acquire_slab() - Get free slab for class_idx
- shared_pool_release_slab() - Return slab when empty
- Per-class hints for fast path optimization
3. **Integration** (23 files modified):
- Updated all ss->size_class → meta->class_idx
- Updated all meta->owner_tid → meta->owner_tid_low
- superslab_refill() now uses shared pool
- Free path releases empty slabs back to pool
4. **Build system** (Makefile):
- Added hakmem_shared_pool.o to OBJS_BASE and TINY_BENCH_OBJS_BASE
## Status: ⚠️ Build OK, Runtime CRASH
**Build**: ✅ SUCCESS
- All 23 files compile without errors
- Only warnings: superslab_allocate type mismatch (legacy code)
**Runtime**: ❌ SEGFAULT
- Crash location: sll_refill_small_from_ss()
- Exit code: 139 (SIGSEGV)
- Test case: ./bench_random_mixed_hakmem 1000 256 42
## Known Issues
1. **SEGFAULT in refill path** - Likely shared_pool_acquire_slab() issue
2. **Legacy superslab_allocate()** still exists (type mismatch warning)
3. **Remaining TODOs** from design doc:
- SuperSlab physical layout integration
- slab_handle.h cleanup
- Remove old per-class head implementation
## Next Steps
1. Debug SEGFAULT (gdb backtrace shows sll_refill_small_from_ss)
2. Fix shared_pool_acquire_slab() or superslab_init_slab()
3. Basic functionality test (1K → 100K iterations)
4. Measure SuperSlab count reduction (877 → 100-200)
5. Performance benchmark (+650-860% expected)
## Files Changed (25 files)
core/box/free_local_box.c
core/box/free_remote_box.c
core/box/front_gate_classifier.c
core/hakmem_super_registry.c
core/hakmem_tiny.c
core/hakmem_tiny_bg_spill.c
core/hakmem_tiny_free.inc
core/hakmem_tiny_lifecycle.inc
core/hakmem_tiny_magazine.c
core/hakmem_tiny_query.c
core/hakmem_tiny_refill.inc.h
core/hakmem_tiny_superslab.c
core/hakmem_tiny_superslab.h
core/hakmem_tiny_tls_ops.h
core/slab_handle.h
core/superslab/superslab_inline.h
core/superslab/superslab_types.h
core/tiny_debug.h
core/tiny_free_fast.inc.h
core/tiny_free_magazine.inc.h
core/tiny_remote.c
core/tiny_superslab_alloc.inc.h
core/tiny_superslab_free.inc.h
Makefile
## New Files (3 files)
PHASE12_SHARED_SUPERSLAB_POOL_DESIGN.md
core/hakmem_shared_pool.c
core/hakmem_shared_pool.h
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: ChatGPT <chatgpt@openai.com>
2025-11-13 16:33:03 +09:00
..
2025-11-13 16:33:03 +09:00
2025-11-13 16:33:03 +09:00
2025-11-11 01:47:06 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-11 01:47:06 +09:00
2025-11-05 12:31:14 +09:00
2025-11-11 01:47:06 +09:00
2025-11-05 12:31:14 +09:00
2025-11-08 17:08:00 +09:00
2025-11-08 17:08:00 +09:00
2025-11-13 14:25:54 +09:00
2025-11-11 01:47:06 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-11 01:47:06 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-13 14:05:39 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-08 12:54:52 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-06 21:54:12 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 01:27:04 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-13 16:33:03 +09:00
2025-11-13 16:33:03 +09:00
2025-11-11 01:47:06 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-13 16:33:03 +09:00
2025-11-13 14:45:43 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-13 06:50:20 +09:00
2025-11-05 12:31:14 +09:00
2025-11-13 06:50:20 +09:00
2025-11-13 06:50:20 +09:00
2025-11-13 06:50:20 +09:00
2025-11-05 12:31:14 +09:00
2025-11-13 06:50:20 +09:00
2025-11-13 16:33:03 +09:00
2025-11-13 06:50:20 +09:00
2025-11-07 01:27:04 +09:00
2025-11-13 14:25:54 +09:00
2025-11-13 14:25:54 +09:00
2025-11-05 12:31:14 +09:00
2025-11-13 06:50:20 +09:00
2025-11-13 16:33:03 +09:00
2025-11-07 01:27:04 +09:00
2025-11-13 06:50:20 +09:00
2025-11-13 06:50:20 +09:00
2025-11-13 06:50:20 +09:00
2025-11-13 14:45:43 +09:00
2025-11-12 13:57:46 +09:00
2025-11-05 12:31:14 +09:00
2025-11-13 16:33:03 +09:00
2025-11-13 16:33:03 +09:00
2025-11-05 12:31:14 +09:00
2025-11-10 16:48:20 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-13 16:33:03 +09:00
2025-11-13 16:33:03 +09:00
2025-11-13 16:33:03 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-13 13:32:58 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-11 10:00:36 +09:00
2025-11-07 01:27:04 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-07 01:27:04 +09:00
2025-11-10 03:00:00 +09:00
2025-11-11 00:02:24 +09:00
2025-11-07 21:45:20 +09:00
2025-11-13 16:33:03 +09:00
2025-11-13 16:33:03 +09:00
2025-11-13 05:43:31 +09:00
2025-11-13 16:33:03 +09:00
2025-11-10 16:48:20 +09:00
2025-11-13 05:21:36 +09:00
2025-11-13 16:33:03 +09:00
2025-11-13 16:33:03 +09:00
2025-11-13 06:50:20 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-05 12:31:14 +09:00
2025-11-11 01:47:06 +09:00
2025-11-05 12:31:14 +09:00
2025-11-11 01:47:06 +09:00
2025-11-10 18:04:08 +09:00
2025-11-05 12:31:14 +09:00
2025-11-09 18:55:50 +09:00
2025-11-09 16:49:34 +09:00
2025-11-08 23:53:25 +09:00
2025-11-09 18:55:50 +09:00
2025-11-09 18:55:50 +09:00
2025-11-09 18:55:50 +09:00
2025-11-09 18:55:50 +09:00
2025-11-09 18:55:50 +09:00
2025-11-09 18:55:50 +09:00
2025-11-09 18:55:50 +09:00
2025-11-09 18:55:50 +09:00
2025-11-09 18:55:50 +09:00
2025-11-13 06:50:20 +09:00
2025-11-13 06:50:20 +09:00
2025-11-13 16:33:03 +09:00
2025-11-13 14:25:54 +09:00
2025-11-13 14:25:54 +09:00
2025-11-13 07:43:30 +09:00
2025-11-13 13:32:58 +09:00
2025-11-13 06:50:20 +09:00
2025-11-06 21:54:12 +09:00
2025-11-05 12:31:14 +09:00
2025-11-13 06:50:20 +09:00
2025-11-13 03:53:01 +09:00
2025-11-13 03:53:01 +09:00
2025-11-13 16:33:03 +09:00
2025-11-13 06:50:20 +09:00
2025-11-13 06:50:20 +09:00
2025-11-09 23:15:02 +09:00
2025-11-13 14:05:39 +09:00
2025-11-13 16:33:03 +09:00
2025-11-13 16:33:03 +09:00
2025-11-07 01:27:04 +09:00
2025-11-13 06:50:20 +09:00
2025-11-07 01:27:04 +09:00
2025-11-05 12:31:14 +09:00
2025-11-07 01:27:04 +09:00
2025-11-07 18:07:48 +09:00
2025-11-13 06:50:20 +09:00
2025-11-07 18:07:48 +09:00
2025-11-13 06:50:20 +09:00
2025-11-07 01:27:04 +09:00
2025-11-13 16:33:03 +09:00
2025-11-05 12:31:14 +09:00
2025-11-11 21:49:05 +09:00
2025-11-07 01:27:04 +09:00
2025-11-05 12:31:14 +09:00
2025-11-13 16:33:03 +09:00
2025-11-13 16:33:03 +09:00
2025-11-06 21:54:12 +09:00
2025-11-07 22:34:24 +09:00
2025-11-05 12:31:14 +09:00