feat(ke): implement qspinlocks

This commit is contained in:
Loïc Grégoire
2026-04-19 10:54:42 -04:00
parent ca6fc21085
commit e235565d81
5 changed files with 288 additions and 39 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ const ke = r.ke;
const mm = r.mm;
const mi = mm.private;
var heap_lock: ke.SpinLock = .init();
var heap_lock: ke.QSpinLock = .init();
var heap_arena: mm.vmem.Arena = undefined;
pub fn init() void {
+2 -2
View File
@@ -185,7 +185,7 @@ pub const Zone = struct {
/// Current color for slab coloring.
color: usize,
/// Zone lock.
lock: ke.SpinLock,
lock: ke.QSpinLock,
/// List of full slabs in this zone.
full_slabs: rtl.List,
/// List of partial slabs in this zone.
@@ -198,7 +198,7 @@ pub const Zone = struct {
hash_mask: usize,
hash_shift: usize,
depot_lock: ke.SpinLock,
depot_lock: ke.QSpinLock,
empty_mags: ?*Magazine,
full_mags: ?*Magazine,