Boxify superslab registry, add bench profile, and document C7 hotpath experiments
This commit is contained in:
@ -16,6 +16,8 @@ typedef struct TinyClassStatsThread {
|
||||
uint64_t uc_miss[TINY_NUM_CLASSES]; // unified_cache_refill() hits
|
||||
uint64_t warm_hit[TINY_NUM_CLASSES]; // warm pool successes
|
||||
uint64_t shared_lock[TINY_NUM_CLASSES]; // shared pool lock acquisitions (hook as needed)
|
||||
uint64_t tls_carve_attempt[TINY_NUM_CLASSES]; // Warm/TLS carve attempts
|
||||
uint64_t tls_carve_success[TINY_NUM_CLASSES]; // Warm/TLS carve successes
|
||||
} TinyClassStatsThread;
|
||||
|
||||
extern __thread TinyClassStatsThread g_tiny_class_stats;
|
||||
@ -24,6 +26,8 @@ extern __thread TinyClassStatsThread g_tiny_class_stats;
|
||||
extern _Atomic uint64_t g_tiny_class_stats_uc_miss_global[TINY_NUM_CLASSES];
|
||||
extern _Atomic uint64_t g_tiny_class_stats_warm_hit_global[TINY_NUM_CLASSES];
|
||||
extern _Atomic uint64_t g_tiny_class_stats_shared_lock_global[TINY_NUM_CLASSES];
|
||||
extern _Atomic uint64_t g_tiny_class_stats_tls_carve_attempt_global[TINY_NUM_CLASSES];
|
||||
extern _Atomic uint64_t g_tiny_class_stats_tls_carve_success_global[TINY_NUM_CLASSES];
|
||||
|
||||
static inline void tiny_class_stats_on_uc_miss(int ci) {
|
||||
if (ci >= 0 && ci < TINY_NUM_CLASSES) {
|
||||
@ -49,6 +53,22 @@ static inline void tiny_class_stats_on_shared_lock(int ci) {
|
||||
}
|
||||
}
|
||||
|
||||
static inline void tiny_class_stats_on_tls_carve_attempt(int ci) {
|
||||
if (ci >= 0 && ci < TINY_NUM_CLASSES) {
|
||||
g_tiny_class_stats.tls_carve_attempt[ci]++;
|
||||
atomic_fetch_add_explicit(&g_tiny_class_stats_tls_carve_attempt_global[ci],
|
||||
1, memory_order_relaxed);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void tiny_class_stats_on_tls_carve_success(int ci) {
|
||||
if (ci >= 0 && ci < TINY_NUM_CLASSES) {
|
||||
g_tiny_class_stats.tls_carve_success[ci]++;
|
||||
atomic_fetch_add_explicit(&g_tiny_class_stats_tls_carve_success_global[ci],
|
||||
1, memory_order_relaxed);
|
||||
}
|
||||
}
|
||||
|
||||
// Optional: reset per-thread counters (cold path only).
|
||||
void tiny_class_stats_reset_thread(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user