fix(scheduler): align(64) on SchedulerStats to prevent false sharing

Adding slot_hits + slot_displacements in RFC 005 grew SchedulerStats
from 16 to 32 bytes — exactly 2 per cache line. run_queue_len (written
on every push/pop by thread N) then false-shared with fields of thread
N+1, causing ~45-60% yield-storm regression at t≥8 visible equally in
slot-on and slot-off paths.
This commit is contained in:
smarm
2026-06-11 22:37:47 +02:00
parent 2708042990
commit 37d931968e
2 changed files with 142 additions and 141 deletions
+1
View File
@@ -275,6 +275,7 @@ impl Default for Config {
/// Lockless per-scheduler-thread counters. Written only by the owning thread;
/// readable from any thread (introspection actor, tests).
#[repr(align(64))]
pub struct SchedulerStats {
/// PID index of the actor currently on-CPU, or `u32::MAX` when idle.
pub current_pid_index: AtomicU32,