From 60a7d7409c91216a11c13abee53066b260edb17a Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Wed, 13 May 2026 15:48:53 +0800 Subject: feat: update slab allocator to use Page descriptors instead of Frame --- na/mm/slab.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'na/mm/slab.h') diff --git a/na/mm/slab.h b/na/mm/slab.h index 716ebe6..909ee62 100644 --- a/na/mm/slab.h +++ b/na/mm/slab.h @@ -7,7 +7,7 @@ * SLUB Allocator — module-private header * * SLUB = Simple List of Unfull Blocks. - * Metadata lives in Frame descriptors (no per-page Slab header). + * Metadata lives in Page descriptors (no per-page Slab header). * Free object list is embedded inside the objects themselves. * Per-CPU "active page" eliminates lock contention on the fast path. * @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include @@ -28,7 +28,7 @@ inline constexpr uint32 kSizeClasses[kNumSizeClasses] = { /* Per-CPU active slab page pointer */ struct PerCpuSlab { - Frame* active; // Currently used slab page (nullptr if none) + Page* active; // Currently used slab page (nullptr if none) }; /* @@ -57,16 +57,16 @@ public: private: // Get a partially-filled page from the partial list (lock must be held) - Frame* get_partial(); + Page* get_partial(); // Put a page onto the partial list (lock must be held) - void put_partial(Frame* f); + void put_partial(Page* page); // Remove a page from the partial list (lock must be held) - void remove_partial(Frame* f); + void remove_partial(Page* page); // Allocate a new page from PMM and format it as a slab - Frame* new_slab(); + Page* new_slab(); Spinlock lock_; // Protects partial_ only list_node partial_; // Partially-filled slab pages -- cgit v1.2.3