Major Features: - Debug counter infrastructure for Refill Stage tracking - Free Pipeline counters (ss_local, ss_remote, tls_sll) - Diagnostic counters for early return analysis - Unified larson.sh benchmark runner with profiles - Phase 6-3 regression analysis documentation Bug Fixes: - Fix SuperSlab disabled by default (HAKMEM_TINY_USE_SUPERSLAB) - Fix profile variable naming consistency - Add .gitignore patterns for large files Performance: - Phase 6-3: 4.79 M ops/s (has OOM risk) - With SuperSlab: 3.13 M ops/s (+19% improvement) This is a clean repository without large log files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
71 lines
2.1 KiB
C
71 lines
2.1 KiB
C
/**
|
||
* hakmem_tiny_config.c
|
||
*
|
||
* Implementation of centralized Tiny configuration constants
|
||
*/
|
||
|
||
#include "hakmem_tiny_config.h"
|
||
|
||
// ============================================================================
|
||
// Fast Cache Configuration
|
||
// ============================================================================
|
||
|
||
// Factory defaults (“balanced”) – mutable at runtime
|
||
static const uint16_t k_fast_cap_defaults_factory[TINY_NUM_CLASSES] = {
|
||
128, // Class 0: 8B
|
||
128, // Class 1: 16B
|
||
128, // Class 2: 32B
|
||
128, // Class 3: 64B (reduced from 512 to limit RSS)
|
||
128, // Class 4: 128B (trimmed via ACE/TLS caps)
|
||
128, // Class 5: 256B
|
||
128, // Class 6: 512B
|
||
0 // Class 7: 1KB (bypass fast cache)
|
||
};
|
||
|
||
uint16_t g_fast_cap_defaults[TINY_NUM_CLASSES] = {
|
||
128, 128, 128, 128, 128, 128, 128, 0
|
||
};
|
||
|
||
void tiny_config_reset_defaults(void) {
|
||
for (int i = 0; i < TINY_NUM_CLASSES; i++) {
|
||
g_fast_cap_defaults[i] = k_fast_cap_defaults_factory[i];
|
||
}
|
||
}
|
||
|
||
// ============================================================================
|
||
// TLS Magazine Configuration
|
||
// ============================================================================
|
||
|
||
// Default TLS magazine capacities per class
|
||
int tiny_default_cap(int class_idx) {
|
||
switch (class_idx) {
|
||
case 0: return 128; // 8B
|
||
case 1: return 128; // 16B
|
||
case 2: return 128; // 32B
|
||
case 3: return 128; // 64B (reduced from 512 to limit RSS)
|
||
case 4: return 96; // 128B (aggressively trimmed to limit RSS)
|
||
case 5: return 128; // 256B
|
||
case 6: return 128; // 512B
|
||
default: return 64; // 1KB
|
||
}
|
||
}
|
||
|
||
// Alias for tiny_default_cap
|
||
int tiny_mag_default_cap(int class_idx) {
|
||
return tiny_default_cap(class_idx);
|
||
}
|
||
|
||
// Maximum allowed TLS magazine capacities per class
|
||
int tiny_cap_max_for_class(int class_idx) {
|
||
switch (class_idx) {
|
||
case 0: return 2048;
|
||
case 1: return 1024;
|
||
case 2: return 768;
|
||
case 3: return 512;
|
||
case 4: return 160;
|
||
case 5: return 256;
|
||
case 6: return 128;
|
||
default: return 64;
|
||
}
|
||
}
|