Linux – Real time priorities in non real time OS

linuxpriorityprocessreal time

If I do the following command on my standard Linux Mint installation:

comp ~ $ ps -eo rtprio,nice,cmd
RTPRIO  NI CMD
...
99   - [migration/0]
99   - [watchdog/0]
99   - [migration/1]
 -   0 [ksoftirqd/1]
99   - [watchdog/1]

I get some of the processes with realtime priority of 99.

What is the meaning of rtprio in a non real time Linux?
Does this mean that if I just run a program with rtprio 99 it runs real time?
Where do real time OSes fall in this story?

Best Answer

"Real time" means processes that must be finished by their deadlines, or Bad Things (TM) happen. A real-time kernel is one in which the latencies by the kernel are strictly bounded (subject to possiby misbehaving hardware which just doesn't answer on time), and in which most any activity can be interrupted to let higher-priority tasks run. In the case of Linux, the vanilla kernel isn't set up for real-time (it has a cost in performance, and the realtime patches floating around depend on some hacks that the core developers consider gross). Besides, running a real-time kernel on a machine that just can't keep up (most personal machines) makes no sense.

That said, the vanilla kernel handles real time priorities, which gives them higher priority than normal tasks, and those tasks will generally run until they voluntarily yield the CPU. This gives better response to those tasks, but means that other tasks get hold off.

Related Question