Files
hakmem/docs/analysis/TINY_C6_HOTPATH_ANALYSIS.md
Moe Charm (CI) 8f18963ad5 Phase 36-37: TinyHotHeap v2 HotBox redesign and C7 current_page policy fixes
- Redefine TinyHotHeap v2 as per-thread Hot Box with clear boundaries
- Add comprehensive OS statistics tracking for SS allocations
- Implement route-based free handling for TinyHeap v2
- Add C6/C7 debugging and statistics improvements
- Update documentation with implementation guidelines and analysis
- Add new box headers for stats, routing, and front-end management
2025-12-08 21:30:21 +09:00

19 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# C6-heavy Hotpath 分析 (Phase47, v2 OFF)
- プロファイル: `HAKMEM_BENCH_MIN_SIZE=257 HAKMEM_BENCH_MAX_SIZE=768 HAKMEM_TINY_HEAP_PROFILE=C7_SAFE HAKMEM_TINY_C7_HOT=1 HAKMEM_TINY_HOTHEAP_V2=0 HAKMEM_TINY_LARSON_FIX=1`
- ベンチ:
- `./bench_random_mixed_hakmem 20000 256 1``Throughput = 39,457,304 ops/s`
- FRONT_CLASS: cls6 alloc/free=5373、cls7 alloc=5692 free=4573
- perf stat (cycles,instructions,task-clock,branch-misses):
- `./bench_random_mixed_hakmem 1000000 400 1`
- cycles=175,790,796 / instructions=368,496,560 (IPC≈2.10)
- task-clock=42.36 ms (user 27.26 ms / sys 16.13 ms), branch-misses=2,206,657
- perf record (cycles, 1M, ws=400):
- 上位は匿名ページフォルト経路が支配的(`__memset_avx2_unaligned_erms``handle_mm_fault``do_anonymous_page``alloc_anon_folio` 系で包含 60%+)。
- ユーザランド側では `free`/`malloc` が目立つが、カーネル first-touch が主因。
## 次に削る箱(候補)
- 最重: first-touch/ゼロイング由来の匿名ページフォルト
- 候補策: class6 向けの温存ページ再利用 / prefault を増やし、ベンチの 1M/400 で pf/sys をさらに削る。
- Tiny v1 自体の命令数は二次的perf で目立たず。C6 を TinyHeap に載せるよりも、先に pf 削減箱を検討するのが妥当。