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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user