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
This commit is contained in:
2026-04-30 18:21:48 +01:00
parent 7d5d364c01
commit 2e99d4073b
70 changed files with 15268 additions and 10 deletions
+2
View File
@@ -6,6 +6,8 @@ patches = [
"P0-workspace-add-bootstrap.patch",
"P0-bootstrap-workspace-fix.patch",
"P2-i2c-gpio-ucsi-drivers.patch",
"P3-pcid-bind-scheme.patch",
"P3-acpi-wave12-hardening.patch",
]
[build]
+1 -1
View File
@@ -1,6 +1,6 @@
[source]
git = "https://gitlab.redox-os.org/redox-os/kernel.git"
patches = ["redox.patch", "P0-canary.patch", "P1-memory-map-overflow.patch", "../../../local/patches/kernel/P4-supplementary-groups.patch"]
patches = ["redox.patch", "P0-canary.patch", "P1-memory-map-overflow.patch", "../../../local/patches/kernel/P4-supplementary-groups.patch", "../../../local/patches/kernel/P4-s3-suspend-resume.patch", "../../../local/patches/kernel/P5-sched-policy-context.patch", "../../../local/patches/kernel/P5-sched-rt-policy.patch", "../../../local/patches/kernel/P5-proc-setschedpolicy.patch", "../../../local/patches/kernel/P5-scheme-sched-id.patch", "../../../local/patches/kernel/P5-context-mod-sched.patch", "../../../local/patches/kernel/P6-vruntime-context.patch", "../../../local/patches/kernel/P6-percpu-runqueues.patch", "../../../local/patches/kernel/P6-futex-sharding.patch", "../../../local/patches/kernel/P6-vruntime-switch.patch", "../../../local/patches/kernel/P7-cache-affine-context.patch", "../../../local/patches/kernel/P7-cache-affine-switch.patch", "../../../local/patches/kernel/P7-proc-setname.patch", "../../../local/patches/kernel/P7-proc-setpriority.patch", "../../../local/patches/kernel/P8-futex-requeue.patch", "../../../local/patches/kernel/P8-futex-pi.patch", "../../../local/patches/kernel/P8-futex-robust.patch", "../../../local/patches/kernel/P8-percpu-wiring.patch", "../../../local/patches/kernel/P8-percpu-sched.patch", "../../../local/patches/kernel/P9-proc-lock-ordering.patch", "../../../local/patches/kernel/P9-futex-pi-cas-fix.patch"]
[build]
template = "custom"
+10
View File
@@ -22,6 +22,7 @@ patches = [
"../../../local/patches/relibc/P3-select-not-epoll-timeout.patch",
"../../../local/patches/relibc/P3-tls-get-addr-panic-fix.patch",
"../../../local/patches/relibc/P3-pthread-yield.patch",
"../../../local/patches/relibc/P3-barrier-smp-futex.patch",
"../../../local/patches/relibc/P3-secure-getenv.patch",
"../../../local/patches/relibc/P3-getentropy.patch",
"../../../local/patches/relibc/P3-dup3.patch",
@@ -38,10 +39,19 @@ patches = [
"../../../local/patches/relibc/P3-header-mod-spawn-threads.patch",
"../../../local/patches/relibc/P3-spawn.patch",
"../../../local/patches/relibc/P3-threads.patch",
"../../../local/patches/relibc/P3-pthread-signal-races.patch",
"../../../local/patches/relibc/P3-sysv-ipc.patch",
"../../../local/patches/relibc/P3-sysv-sem-impl.patch",
"../../../local/patches/relibc/P3-sysv-shm-impl.patch",
"../../../local/patches/relibc/P4-setgroups-getgroups.patch",
"../../../local/patches/relibc/P5-robust-mutexes.patch",
"../../../local/patches/relibc/P5-sched-api.patch",
"../../../local/patches/relibc/P5-pthread-sigmask-race.patch",
"../../../local/patches/relibc/P4-setgroups-unsafe-fix.patch",
"../../../local/patches/relibc/P7-setpriority.patch",
"../../../local/patches/relibc/P7-pthread-affinity.patch",
"../../../local/patches/relibc/P7-pthread-setname.patch",
"../../../local/patches/relibc/P9-spin-and-barrier.patch",
]
[build]