Boxify superslab registry, add bench profile, and document C7 hotpath experiments
This commit is contained in:
@ -43,6 +43,16 @@ extern _Atomic uint64_t g_free_ss_enter;
|
||||
extern _Atomic uint64_t g_free_local_box_calls;
|
||||
extern _Atomic uint64_t g_free_remote_box_calls;
|
||||
|
||||
// ============================================================================
|
||||
// Superslab / Slab live-state observability (Tiny classes 0..7)
|
||||
// ============================================================================
|
||||
// NOTE: These are “event-style” counters updated at key transitions
|
||||
// (alloc/free/reset) to keep overhead minimal. They are intended for
|
||||
// regression detection and coarse budgeting rather than exact gauges.
|
||||
extern _Atomic uint64_t g_ss_live_by_class[8]; // +1 on alloc, -1 on free (best-effort)
|
||||
extern _Atomic uint64_t g_ss_empty_events[8]; // Observations of fully-empty Superslabs
|
||||
extern _Atomic uint64_t g_slab_live_events[8]; // Observations of live slabs during scans
|
||||
|
||||
// ============================================================================
|
||||
// Statistics Update API
|
||||
// ============================================================================
|
||||
@ -59,6 +69,11 @@ void ss_stats_cache_reuse(void);
|
||||
// Thread-safe: mutex protected
|
||||
void ss_stats_cache_store(void);
|
||||
|
||||
// Event-style observability helpers (Tiny classes only, relaxed atomics)
|
||||
void ss_stats_on_ss_alloc_class(int class_idx);
|
||||
void ss_stats_on_ss_free_class(int class_idx);
|
||||
void ss_stats_on_ss_scan(int class_idx, int slab_live, int is_empty);
|
||||
|
||||
// ============================================================================
|
||||
// Statistics Reporting API
|
||||
// ============================================================================
|
||||
@ -69,4 +84,7 @@ void superslab_print_stats(SuperSlab* ss);
|
||||
// Print global SuperSlab statistics
|
||||
void superslab_print_global_stats(void);
|
||||
|
||||
// ENV: HAKMEM_SS_STATS_DUMP=1 → dump coarse Superslab/slab counters once
|
||||
void ss_stats_dump_if_requested(void);
|
||||
|
||||
#endif // HAKMEM_SS_STATS_BOX_H
|
||||
|
||||
Reference in New Issue
Block a user