Files
hakmem/docs/TINY_P0_BATCH_REFILL.md
Moe Charm (CI) 70ad1ffb87 Tiny: Enable P0→FC direct path for class7 (1KB) by default + docs
- Class7 (1KB): P0 direct-to-FastCache now default ON (HAKMEM_TINY_P0_DIRECT_FC_C7 unset or not '0').
- Keep A/B gates: HAKMEM_TINY_P0_ENABLE, HAKMEM_TINY_P0_DIRECT_FC (class5), HAKMEM_TINY_P0_DIRECT_FC_C7 (class7),
  HAKMEM_TINY_P0_DRAIN_THRESH (default 32), HAKMEM_TINY_P0_NO_DRAIN, HAKMEM_TINY_P0_LOG.
- P0 batch now supports class7 direct fill in addition to class5: gather (drain thresholded → freelist pop → linear carve)
  without writing into objects, then bulk-push into FC, update meta/active counters once.
- Docs: Update direct-FC defaults (class5+class7 ON) in docs/TINY_P0_BATCH_REFILL.md.

Notes
- Use tools/bench_rs_from_files.sh for RS(hakmem/system) to compare runs across CPUs.
- Next: parameter sweep for class7 (FC cap/batch limit/drain threshold) and perf counters A/B.
2025-11-09 23:15:02 +09:00

1.5 KiB
Raw Blame History

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
  • 直詰めP0→FC:
    • class5(256B): 既定ONHAKMEM_TINY_P0_DIRECT_FC=0でOFF
    • class7(1KB): 既定ONHAKMEM_TINY_P0_DIRECT_FC_C7=0でOFF
  • 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