Commit Graph

4 Commits

Author SHA1 Message Date
39a3c53dbc 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>
2025-12-12 03:12:28 +09:00
2b35de2123 MID-V3 Phase 0-2: Design doc, type skeleton, and RegionIdBox API
- MID-V3-0: Create design doc (docs/analysis/MID_POOL_V3_DESIGN.md)
  - Lane vs Page role clarification
  - Phase plan and checklist

- MID-V3-1: Type skeleton + ENV
  - MidHotBoxV3, MidLaneV3, MidPageDescV3 structures
  - ENV controls (HAKMEM_MID_V3_ENABLED, HAKMEM_MID_V3_CLASSES)
  - Cold interface declarations

- MID-V3-2 (V6-HDR-2): RegionIdBox Registration API completion
  - RegionEntry structure with sorted array storage
  - Binary search lookup implementation
  - region_id_register_v6() / region_id_unregister_v6()
  - REGION_KIND_MID_V3 added to enum

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 00:46:25 +09:00
ce372cfc7e Phase V6-HDR-4: Headerless 最適化 (P0 + P1)
## P0: Double validation 排除
- region_id_lookup_v6() で TLS segment 登録済み + 範囲内なら
  small_page_meta_v6_of() を呼ばずに直接 page_meta を計算
- 削除された重複チェック:
  - slot->in_use (TLS登録で保証)
  - small_ptr_in_segment_v6() (addr範囲で既にチェック済み)
  - 関数呼び出しオーバーヘッド
- 推定効果: +1-2% (6-8 instructions 削減)

## P1: TLS cache に page_meta キャッシュ追加
- RegionIdTlsCache に追加:
  - last_page_base / last_page_end (ページ範囲)
  - last_page (SmallPageMetaV6* 直接ポインタ)
- region_id_lookup_cached_v6() で same-page hit 時は
  page_meta lookup を完全スキップ
- 推定効果: +1.5-2.5% (10-12 instructions 削減)

## ベンチマーク結果 (揺れあり)
- V6-HDR-3 (P0/P1 前): -3.5% ~ -8.3% 回帰
- V6-HDR-4 (P0+P1 後): +2.7% ~ +12% 改善 (一部の run で)

設計原則:
- RegionIdBox は薄く保つ (分類のみ)
- キャッシュは TLS 側に寄せる
- same-page 判定で last_page_base/end を使用

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 00:16:32 +09:00
df216b6901 Phase V6-HDR-3: SmallSegmentV6 実割り当て & RegionIdBox Registration
実装内容:
1. SmallSegmentV6のmmap割り当ては既に v6-0で実装済み
2. small_heap_ctx_v6() で segment 取得時に region_id_register_v6_segment() 呼び出し
3. region_id_v6.c に TLS スコープのセグメント登録ロジック実装:
   - 4つの static __thread 変数でセグメント情報をキャッシュ
   - region_id_register_v6_segment(): セグメント base/end を TLS に記録
   - region_id_lookup_v6(): TLS segment の range check を最初に実行
   - TLS cache 更新で O(1) lookup 実現
4. region_id_v6_box.h に SmallSegmentV6 type include & function 宣言追加
5. small_v6_region_observe_validate() に region_id_observe_lookup() 呼び出し追加

効果:
- HeaderlessデザインでRegionIdBoxが正式にSMALL_V6分類を返せるように
- TLS-scopedな簡潔な登録メカニズム (マルチスレッド対応)
- Fast path: TLS segment range check -> page_meta lookup
- Fall back path: 従来の small_page_meta_v6_of() による動的検出
- Latency: O(1) TLS cache hit rate がv6 alloc/free の大部分をカバー

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-11 23:51:48 +09:00