mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-21 12:29:43 -10:00
Since Linux 6.12 a time-shared thread may ask for its own EEVDF slice through sched_setattr(), with no capability or rlimit. A new backend, frontend/thread_elevation/eevdf.c, asks for the kernel's shortest, 0.1 ms, so the thread gets an earlier deadline and the CPU sooner when it wakes, with its share of the CPU unchanged. It leaves a real-time, batch or idle thread alone, and counts only when the slice reads back as asked, which kernels before 6.12 do not do. Under two busy threads on one CPU, an audio-shaped thread's p99 wake-up lateness drops from about 3 ms to under 0.1 ms, and a burst longer than the slice completes no later than before. The chain gains additive backends: self-acting, tried first, and never ending the chain, since a scheduler hint complements a raised priority rather than standing in for it; a continuation never reaches one. thread_elevation_raise_current() reports one that applied, and the audio thread logs it. samples/frontend/thread_elevation covers additive ordering and continuation, and runs the real backend on the kernel it finds: granted with the slice read back where it is supported, and a real-time thread left as it is.