Files
hakmem/docs/TINY_P0_BATCH_REFILL.md
Moe Charm (CI) d9b334b968 Tiny: Enable P0 batch refill by default + docs and task update
Summary
- Default P0 ON: Build-time HAKMEM_TINY_P0_BATCH_REFILL=1 remains; runtime gate now defaults to ON
  (HAKMEM_TINY_P0_ENABLE unset or not '0'). Kill switch preserved via HAKMEM_TINY_P0_DISABLE=1.
- Fix critical bug: After freelist→SLL batch splice, increment TinySlabMeta::used by 'from_freelist'
  to mirror non-P0 behavior (prevents under-accounting and follow-on carve invariants from breaking).
- Add low-overhead A/B toggles for triage: HAKMEM_TINY_P0_NO_DRAIN (skip remote drain),
  HAKMEM_TINY_P0_LOG (emit [P0_COUNTER_OK/MISMATCH] based on total_active_blocks delta).
- Keep linear carve fail-fast guards across simple/general/TLS-bump paths.

Perf (1T, 100k×256B)
- P0 OFF: ~2.73M ops/s (stable)
- P0 ON (no drain): ~2.45M ops/s
- P0 ON (normal drain): ~2.76M ops/s (fastest)

Known
- Rare [P0_COUNTER_MISMATCH] warnings persist (non-fatal). Continue auditing active/used
  balance around batch freelist splice and remote drain splice.

Docs
- Add docs/TINY_P0_BATCH_REFILL.md (runtime switches, behavior, perf notes).
- Update CURRENT_TASK.md with Tiny P0 status (default ON) and next steps.
2025-11-09 22:12:34 +09:00

29 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.

Tiny P0 Batch Refill — 運用ガイドデフォルトON
概要
- TinyのSuperslab→TLS(SLL)補充をバッチ化して分岐・書き込み・メモリアクセスを削減し、スループットを向上します。
- 本リポジトリではデフォルトONビルド時: HAKMEM_TINY_P0_BATCH_REFILL=1、実行時: 既定ON
利点
- 1回のdrain / 1回のSLL splice / まとめたactive加算で負荷削減
- 連続carveでキャッシュ効率が高い
既知の注意点(監査継続)
- カウンタ不整合の警告([P0_COUNTER_MISMATCH])が残存する場合がありますが、致命的ではありません。監査継続中。
ランタイムA/Bスイッチ
- P0有効化既定: HAKMEM_TINY_P0_ENABLE unset or not '0'
- P0無効化: HAKMEM_TINY_P0_ENABLE=0 もしくは HAKMEM_TINY_P0_DISABLE=1
- Remote drain無効切り分け用: HAKMEM_TINY_P0_NO_DRAIN=1
- P0ログ: HAKMEM_TINY_P0_LOG=1active_delta と taken の一致検査を出力)
ベンチ指標(例)
- P0 OFF: ~2.73M ops/s100k×256B, 1T
- P0 ON: ~2.76M ops/s同条件, 最速)
実装の主な場所
- 本体: core/hakmem_tiny_refill_p0.inc.hsll_refill_batch_from_ss
- ヘルパ: core/tiny_refill_opt.htrc_*
- Remote drain: core/superslab/superslab_inline.h_ss_remote_drain_to_freelist_unsafe