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:
Moe Charm (CI)
2025-11-26 14:45:26 +09:00
parent 67fb15f35f
commit a9ddb52ad4
235 changed files with 542 additions and 44504 deletions

View File

@ -22,15 +22,8 @@ static inline uintptr_t bench_pub_pop(int class_idx);
static inline SuperSlab* slab_entry_ss(uintptr_t ent);
static inline int slab_entry_idx(uintptr_t ent);
// A/B gate: fully disable mailbox/ready consumption for isolation runs
static inline int tiny_mail_ready_allowed(void) {
static int g = -1;
if (__builtin_expect(g == -1, 0)) {
const char* e = getenv("HAKMEM_TINY_DISABLE_READY");
g = (e && *e && *e != '0') ? 0 : 1; // default ON
}
return g;
}
// Mailbox/Ready consumption always allowed (ENV gate removed)
static inline int tiny_mail_ready_allowed(void) { return 1; }
// Registry scan window (ENV: HAKMEM_TINY_REG_SCAN_MAX, default 256)
static inline int tiny_reg_scan_max(void) {
@ -48,37 +41,9 @@ static inline int tiny_reg_scan_max(void) {
return v;
}
// Opportunistic background remote-drain knobs (ENV parsed lazily)
static inline int tiny_bg_remote_tryrate(void) {
static int v = -1;
if (__builtin_expect(v == -1, 0)) {
const char* s = getenv("HAKMEM_TINY_BG_REMOTE_TRYRATE");
int defv = 16;
if (s && *s) {
int t = atoi(s);
v = (t > 0) ? t : defv;
} else {
v = defv;
}
}
return v;
}
static inline int tiny_bg_remote_budget_default(void) {
static int b = -1;
if (__builtin_expect(b == -1, 0)) {
const char* s = getenv("HAKMEM_TINY_BG_REMOTE_BUDGET");
int defb = 2;
if (s && *s) {
int t = atoi(s);
if (t <= 0) t = defb; if (t > 64) t = 64;
b = t;
} else {
b = defb;
}
}
return b;
}
// Opportunistic background remote-drain knobs (ENV removed; fixed defaults)
static inline int tiny_bg_remote_tryrate(void) { return 16; }
static inline int tiny_bg_remote_budget_default(void) { return 2; }
// Mid-size simple refill (ENV: HAKMEM_TINY_MID_REFILL_SIMPLE)
static inline int tiny_mid_refill_simple_enabled(void) {
@ -95,13 +60,7 @@ static inline SuperSlab* tiny_refill_try_fast(int class_idx, TinyTLSSlab* tls) {
ROUTE_BEGIN(class_idx); ROUTE_MARK(0);
// Ready list (Box: Ready) — O(1) candidates published by free/publish
{
// ENV: HAKMEM_TINY_READY_BUDGET (default 1)
static int rb = -1;
if (__builtin_expect(rb == -1, 0)) {
const char* s = getenv("HAKMEM_TINY_READY_BUDGET");
int defv = 1;
if (s && *s) { int v = atoi(s); rb = (v > 0 && v <= 8) ? v : defv; } else rb = defv;
}
const int rb = 1; // Ready budget fixed (ENV removed)
for (int attempt = 0; attempt < rb; attempt++) {
ROUTE_MARK(1); // ready_try
uintptr_t ent = tiny_mail_ready_allowed() ? tiny_ready_pop(class_idx) : (uintptr_t)0;
@ -341,20 +300,10 @@ static inline SuperSlab* tiny_refill_try_fast(int class_idx, TinyTLSSlab* tls) {
}
// Ready Aggregator: peek mailbox and surface one hint into Ready
do {
static int agg_en = -1; // ENV: HAKMEM_TINY_READY_AGG=1
if (__builtin_expect(agg_en == -1, 0)) {
const char* e = getenv("HAKMEM_TINY_READY_AGG");
agg_en = (e && *e && *e != '0') ? 1 : 0;
}
const int agg_en = 0; // Ready aggregator ENV removed (fixed OFF)
if (agg_en && tiny_mail_ready_allowed()) {
// Budget: ENV HAKMEM_TINY_READY_AGG_MAIL_BUDGET (default 1)
static int mb = -1;
if (__builtin_expect(mb == -1, 0)) {
const char* s = getenv("HAKMEM_TINY_READY_AGG_MAIL_BUDGET");
int defb = 1; if (s && *s) { int v = atoi(s); mb = (v>0 && v<=4)?v:defb; } else mb = defb;
}
const int mb = 1;
tiny_ready_bg_aggregate_step(class_idx, mb);
// Try Ready once more after aggregation
uintptr_t ent3 = tiny_ready_pop(class_idx);
if (ent3) {
SuperSlab* ss3 = slab_entry_ss(ent3);