Phase 9-2: Remove Legacy Backend & Unify to Shared Pool (50M ops/s)

- Removed Legacy Backend fallback; Shared Pool is now the sole backend.
- Removed Soft Cap limit in Shared Pool to allow full memory management.
- Implemented EMPTY slab recycling with batched meta->used decrement in remote drain.
- Updated tiny_free_local_box to return is_empty status for safe recycling.
- Fixed race condition in release path by removing from legacy list early.
- Achieved 50.3M ops/s in WS8192 benchmark (+200% vs baseline).
This commit is contained in:
Moe Charm (CI)
2025-12-01 13:47:23 +09:00
parent 3a040a545a
commit 0bc33dc4f5
7 changed files with 92 additions and 102 deletions

View File

@ -418,19 +418,8 @@ stage2_fallback:
}
// Before creating a new SuperSlab, consult learning-layer soft cap.
// If current active slots for this class already exceed the policy cap,
// fail early so caller can fall back to legacy backend.
uint32_t limit = sp_class_active_limit(class_idx);
if (limit > 0) {
uint32_t cur = g_shared_pool.class_active_slots[class_idx];
if (cur >= limit) {
if (g_lock_stats_enabled == 1) {
atomic_fetch_add(&g_lock_release_count, 1);
}
pthread_mutex_unlock(&g_shared_pool.alloc_lock);
return -1; // Soft cap reached for this class
}
}
// Phase 9-2: Soft Cap removed to allow Shared Pool to fully replace Legacy Backend.
// We now rely on LRU eviction and EMPTY recycling to manage memory pressure.
// Create metadata for this new SuperSlab
SharedSSMeta* new_meta = sp_meta_find_or_create(new_ss);