Tiny: enable class7 (1024B) fast_cap by default (64); add 1T A/B switch for Remote Side (HAKMEM_TINY_ASSUME_1T)
Changes - core/hakmem_tiny_config.c: set g_fast_cap_defaults[7]=64 (was 0) to reduce SuperSlab path frequency for 1024B. - core/tiny_remote.c: add env HAKMEM_TINY_ASSUME_1T=1 to disable Remote Side table in single‑thread runs (A/B friendly). A/B (1T, cpu2 pinned, 500k iters) - 256B: cycles ↓ ~119.7M → ~60.0M, time 95.4ms → 83.2ms (~12% faster), IPC ~0.92→0.88, branch‑miss ~11%. - 1024B: cycles ↓ ~74.4M → ~27.3M, time 83.3ms → 73.5ms (~12% faster), IPC ~0.82→0.75, branch‑miss ~11%. Notes - Branch‑miss率は依然高め。今後: adopt境界の分岐整理、超シンプルrefill(class7特例)/fast path優先度の再調整で詰める。 - A/B: export HAKMEM_TINY_ASSUME_1T=1 で1T時にRemote SideをOFF。HAKMEM_TINY_REMOTE_SIDEで明示的制御も可。
This commit is contained in:
@ -19,11 +19,11 @@ static const uint16_t k_fast_cap_defaults_factory[TINY_NUM_CLASSES] = {
|
||||
128, // Class 4: 128B (trimmed via ACE/TLS caps)
|
||||
128, // Class 5: 256B
|
||||
128, // Class 6: 512B
|
||||
0 // Class 7: 1KB (bypass fast cache)
|
||||
64 // Class 7: 1KB (enable small fast cache to reduce Superslab path)
|
||||
};
|
||||
|
||||
uint16_t g_fast_cap_defaults[TINY_NUM_CLASSES] = {
|
||||
128, 128, 128, 128, 128, 128, 128, 0
|
||||
128, 128, 128, 128, 128, 128, 128, 64
|
||||
};
|
||||
|
||||
void tiny_config_reset_defaults(void) {
|
||||
|
||||
@ -22,7 +22,7 @@ typedef struct {
|
||||
} rem_side_entry;
|
||||
|
||||
static rem_side_entry g_rem_side[REM_SIDE_SIZE];
|
||||
int g_remote_side_enable = 1; // 強制有効化: ブロックメモリへのnext埋め込みを回避
|
||||
int g_remote_side_enable = 1; // default ON; can be disabled via env or 1T hint
|
||||
extern int g_debug_remote_guard;
|
||||
static _Atomic int g_remote_scribble_once = 0;
|
||||
static _Atomic uintptr_t g_remote_watch_ptr = 0;
|
||||
@ -647,6 +647,12 @@ void tiny_remote_side_init_from_env(void) {
|
||||
if (side_env && *side_env) {
|
||||
enable = (atoi(side_env) != 0);
|
||||
}
|
||||
// Optional: assume single-thread mode and disable side-table to reduce overhead
|
||||
// Use HAKMEM_TINY_ASSUME_1T=1 to hint 1-thread operation (benchmarks).
|
||||
const char* one_t = getenv("HAKMEM_TINY_ASSUME_1T");
|
||||
if (one_t && atoi(one_t) != 0) {
|
||||
enable = 0;
|
||||
}
|
||||
if (!enable && __builtin_expect(g_debug_remote_guard, 0)) {
|
||||
enable = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user