Sample Header Ad - 728x90

How does a vanilla Linux kernel handle realtime scheduling?

1 vote
1 answer
72 views
I have a question regarding "Realtime" support in Linux/Ubuntu: After some reasearch onthe topic, it seems that "realtime" support in Linux is twofold: On the one hand, there is the [**PREEMPT_RT**](https://en.wikipedia.org/wiki/PREEMPT_RT) patch, which brings *"real-time computing"* capabilities to the Linux kernel; on the other hand, there are the so-called **"realtime" [scheduling strategies](https://man7.org/linux/man-pages/man7/sched.7.html)** , such as SCHED_FIFO, SCHED_RR and SCHED_DEADLINE, which have been available for a long time. But how does it all come together? What happens if I use one of the *"realtime" scheduling strategies* (e.g. SCHED_DEADLINE) on a "vanilla" kernel, i.e. one that does **not** have PREEMPT_RT enabled? One would assume that this is **not** even possible. But it seems that it ***is*** possible, according to my test on a "vanilla" (non-realtime) kernel! What does it mean? Do the "realtime" scheduling strategies still work with the "non-realtime" kernel, just not "as good"? Or does it mean that the *"realtime" scheduling strategies* silently are the same as SHED_OTHER when running on a "non-realtime" kernel? Furthermore, assuming that I'm using a "realtime" kernel, i.e. one that *does* have PREEMPT_RT enabled: Will there be ***any*** difference at all, compared to a "vanilla" (non-realtime) kernel, if I do **not** explicitely start any processes with one of the "realtime" scheduling strategies? (Bonus question: How does the "niceness" play together with "realtime" scheduling? I have been looking for information, but all sources explain "niceness" *only* in the context of SHED_OTHER)
Asked by LightBulb (13 rep)
Mar 13, 2025, 02:04 PM
Last activity: Mar 13, 2025, 02:50 PM