Phase v7-2: SmallObject v7 C6-only implementation with RegionIdBox integration

- SmallSegment_v7: 2MiB segment with TLS slot and free page stack
- ColdIface_v7: Page refill/retire between HotBox and SegmentBox
- HotBox_v7: Full C6-only alloc/free with header writing (HEADER_MAGIC|class_idx)
- Free path early-exit: Check v7 route BEFORE ss_fast_lookup (separate mmap segment)
- RegionIdBox: Register v7 segment for ptr->region lookup
- Benchmark: v7 ON ~54.5M ops/s (-7% overhead vs 58.6M legacy baseline)

v7 correctly balances alloc/free counts and page lifecycle.
RegionIdBox overhead identified as primary cost driver.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Moe Charm (CI)
2025-12-12 03:12:28 +09:00
parent a8d0ab06fc
commit 39a3c53dbc
17 changed files with 1729 additions and 61 deletions

View File

@ -36,6 +36,8 @@ HAKMEM_BENCH_MAX_SIZE=1024
- `HAKMEM_POOL_V2_ENABLED=0`
- `HAKMEM_TINY_FRONT_V3_ENABLED=1`
- `HAKMEM_TINY_FRONT_V3_LUT_ENABLED=1`
- `HAKMEM_MID_V3_ENABLED=1`Phase MID-V3: 257-768B, C6 only
- `HAKMEM_MID_V3_CLASSES=0x40`C6 only, C7 は ULTRA に任せる)
### 任意オプション
- stats を見たいとき:
@ -67,8 +69,10 @@ HAKMEM_THP=auto
- C6-heavy mid/smallmid のベンチ用。
- C6 は v1 固定C6 v3/v4/ULTRA は研究箱のみ。Pool v2 OFF。Pool v1 flatten は bench 用に opt-in。
### ENVv1 基準線)
### ENVv1 基準線 + MID v3
```sh
HAKMEM_PROFILE=C6_HEAVY_LEGACY_POOLV1
# または直接指定:
HAKMEM_BENCH_MIN_SIZE=257
HAKMEM_BENCH_MAX_SIZE=768
HAKMEM_TINY_HEAP_PROFILE=C7_SAFE
@ -78,6 +82,8 @@ HAKMEM_SMALL_HEAP_V3_ENABLED=1
HAKMEM_SMALL_HEAP_V3_CLASSES=0x80 # C7-only v3, C6 v3 は OFF
HAKMEM_POOL_V2_ENABLED=0
HAKMEM_POOL_V1_FLATTEN_ENABLED=0 # flatten は初回 OFF
HAKMEM_MID_V3_ENABLED=1 # Phase MID-V3: 257-768B, C6 only
HAKMEM_MID_V3_CLASSES=0x40 # C6 only (+11% on C6-heavy)
```
- mid_desc_lookup TLS キャッシュを試すときだけ: `HAKMEM_MID_DESC_CACHE_ENABLED=1` を上乗せ(デフォルトは OFF