Files
RedBear-OS/local/patches/kernel/P9-futex-pi-cas-fix.patch
T
vasilito 34360e1e4f feat: P0-P6 kernel scheduler + relibc threading comprehensive implementation
P0-P2: Barrier SMP, sigmask/pthread_kill races, robust mutexes, RT scheduling, POSIX sched API
P3: PerCpuSched struct, per-CPU wiring, work stealing, load balancing, initial placement
P4: 64-shard futex table, REQUEUE, PI futexes (LOCK_PI/UNLOCK_PI/TRYLOCK_PI), robust futexes, vruntime tracking, min-vruntime SCHED_OTHER selection
P5: setpriority/getpriority, pthread_setaffinity_np, pthread_setname_np, pthread_setschedparam (Redox)
P6: Cache-affine scheduling (last_cpu + vruntime bonus), NUMA topology kernel hints + numad userspace daemon

Stability fixes: make_consistent stores 0 (dead TID fix), cond.rs error propagation, SPIN_COUNT adaptive spinning, Sys::open &str fix, PI futex CAS race, proc.rs lock ordering, barrier destroy

Patches: 33 kernel + 58 relibc patches, all tracked in recipes
Docs: KERNEL-SCHEDULER-MULTITHREAD-IMPROVEMENT-PLAN.md updated, SCHEDULER-REVIEW-FINAL.md created
Architecture: NUMA topology parsing stays userspace (numad daemon), kernel stores lightweight NumaTopology hints
2026-04-30 18:21:48 +01:00

22 lines
1.1 KiB
Diff

diff --git a/src/syscall/futex.rs b/src/syscall/futex.rs
--- a/src/syscall/futex.rs
+++ b/src/syscall/futex.rs
@@
- let futex_atomic = futex_atomic_u32(locked_physaddr);
- let mut current = futex_atomic.load(Ordering::SeqCst);
+ let futex_atomic = futex_atomic_u32(locked_physaddr);
+ let mut current = futex_atomic.load(Ordering::SeqCst);
+ let queue = futexes
+ .entry(locked_physaddr)
+ .or_insert_with(FutexQueue::default);
loop {
let owner_tid = current & FUTEX_TID_MASK;
- let queue = futexes
- .entry(locked_physaddr)
- .or_insert_with(FutexQueue::default);
let desired_waiters = if queue.waiters.is_empty() {
0
} else {
FUTEX_WAITERS