ENV cleanup: Remove BG/HotMag vars & guard fprintf (Larson 52.3M ops/s)
Phase 1 完了:環境変数整理 + fprintf デバッグガード ENV変数削除(BG/HotMag系): - core/hakmem_tiny_init.inc: HotMag ENV 削除 (~131 lines) - core/hakmem_tiny_bg_spill.c: BG spill ENV 削除 - core/tiny_refill.h: BG remote 固定値化 - core/hakmem_tiny_slow.inc: BG refs 削除 fprintf Debug Guards (#if !HAKMEM_BUILD_RELEASE): - core/hakmem_shared_pool.c: Lock stats (~18 fprintf) - core/page_arena.c: Init/Shutdown/Stats (~27 fprintf) - core/hakmem.c: SIGSEGV init message ドキュメント整理: - 328 markdown files 削除(旧レポート・重複docs) 性能確認: - Larson: 52.35M ops/s (前回52.8M、安定動作✅) - ENV整理による機能影響なし - Debug出力は一部残存(次phase で対応) 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
// Boundary:
|
||||
// - Producer: publish境界(ss_partial_publish)/ remote初入荷 / first-free(prev==NULL)で push
|
||||
// - Consumer: refill境界(tiny_refill_try_fast の最初)で pop→owner取得→bind
|
||||
// A/B: ENV HAKMEM_TINY_READY=0 で無効化
|
||||
// Runtime ENV toggle removed: Ready ring is always enabled (fixed behavior)
|
||||
|
||||
#pragma once
|
||||
#include <stdatomic.h>
|
||||
@ -19,39 +19,10 @@
|
||||
static _Atomic(uintptr_t) g_ready_ring[TINY_NUM_CLASSES][TINY_READY_RING];
|
||||
static _Atomic(uint32_t) g_ready_rr[TINY_NUM_CLASSES];
|
||||
|
||||
static inline int tiny_ready_enabled(void) {
|
||||
static int g_ready_en = -1;
|
||||
if (__builtin_expect(g_ready_en == -1, 0)) {
|
||||
// Hard disable gate for isolation runs
|
||||
const char* dis = getenv("HAKMEM_TINY_DISABLE_READY");
|
||||
if (dis && atoi(dis) != 0) {
|
||||
g_ready_en = 0;
|
||||
return g_ready_en;
|
||||
}
|
||||
const char* e = getenv("HAKMEM_TINY_READY");
|
||||
// Default ON unless explicitly disabled
|
||||
g_ready_en = (e && *e == '0') ? 0 : 1;
|
||||
}
|
||||
return g_ready_en;
|
||||
}
|
||||
static inline int tiny_ready_enabled(void) { return 1; }
|
||||
|
||||
// Optional: limit scan width (ENV: HAKMEM_TINY_READY_WIDTH, default TINY_READY_RING)
|
||||
static inline int tiny_ready_width(void) {
|
||||
static int w = -1;
|
||||
if (__builtin_expect(w == -1, 0)) {
|
||||
const char* e = getenv("HAKMEM_TINY_READY_WIDTH");
|
||||
int defw = TINY_READY_RING;
|
||||
if (e && *e) {
|
||||
int v = atoi(e);
|
||||
if (v <= 0) v = defw;
|
||||
if (v > TINY_READY_RING) v = TINY_READY_RING;
|
||||
w = v;
|
||||
} else {
|
||||
w = defw;
|
||||
}
|
||||
}
|
||||
return w;
|
||||
}
|
||||
// Optional: limit scan width (ENV toggle removed; width is fixed to TINY_READY_RING)
|
||||
static inline int tiny_ready_width(void) { return TINY_READY_RING; }
|
||||
|
||||
// Encode helpers are declared in main TU; forward here
|
||||
static inline uintptr_t slab_entry_make(SuperSlab* ss, int slab_idx);
|
||||
|
||||
Reference in New Issue
Block a user