Boxify superslab registry, add bench profile, and document C7 hotpath experiments

This commit is contained in:
Moe Charm (CI)
2025-12-07 03:12:27 +09:00
parent 18faa6a1c4
commit fda6cd2e67
71 changed files with 2052 additions and 286 deletions

View File

@ -7,6 +7,8 @@
#include "superslab/superslab_inline.h" // superslab_ref_get guard for TLS pins
#include "box/ss_release_guard_box.h" // Box: SuperSlab Release Guard
#include "box/ss_slab_reset_box.h" // Box: Reset slab metadata on reuse path
#include "box/ss_stats_box.h" // Observability: Superslab/slab counters
#include "box/ss_budget_box.h" // Budget guard (global/class caps)
#include <stdlib.h>
#include <stdio.h>
@ -217,6 +219,8 @@ shared_pool_release_slab(SuperSlab* ss, int slab_idx)
slab_meta->class_idx = 255; // UNASSIGNED
// P1.1: Mark class_map as UNASSIGNED when releasing slab
ss->class_map[slab_idx] = 255;
// Reset slab metadata to a pristine state for all classes (C0C7)
ss_slab_reset_meta_for_tiny(ss, slab_idx, -1);
if (ss->active_slabs > 0) {
ss->active_slabs--;
@ -284,6 +288,8 @@ shared_pool_release_slab(SuperSlab* ss, int slab_idx)
// Free SuperSlab immediately (bypasses normal active_slots==0 check)
extern void superslab_free(SuperSlab* ss);
ss_stats_on_ss_free_class(class_idx);
ss_budget_on_free(class_idx);
superslab_free(ss);
return;
}
@ -321,6 +327,8 @@ shared_pool_release_slab(SuperSlab* ss, int slab_idx)
// If so, we must NOT free the SS.
if (ss_release_guard_superslab_can_free(ss)) {
extern void superslab_free(SuperSlab* ss);
ss_stats_on_ss_free_class(class_idx);
ss_budget_on_free(class_idx);
superslab_free(ss);
} else {
#if !HAKMEM_BUILD_RELEASE