Realtime OS: PREEMPT_RT Linux vs QNX and other

141 views Asked by At

I have a lot of questions on Linux with RT-patch vs native RT OS and applications. Please answer them because there's few information on RT applications, unfortunatelly..

Can you please explain does PREEMPT_RT makes Linux with user applications hard real-time system or it's soft/firm real-time system? (Differences between hard real-time, soft real-time, and firm real-time?)

  1. If it's true (it's hard real-time system), what conditions should be met to conform these requirements? As far as I know (please correct me if I'm wrong), these conditions should be met to call linux system with PREEMPT_RT real-time:
    • All system drivers should be refactored to conform to realtime requirements.
    • User applications must run on different CPU core
    • User applications must be refactored to conform to to realtime requirements.

Is that true? And if these conditions are met, can this system called hard real-time? Does PREEMPT_RT also provides required drivers (ethernet etc.) that conform to real-time requirements or just users have to refactor them by themselves?

2.If it's hard real-time system, what pros and cons versus classic realtime systems like QNX? May be QNX has less interrupt reaction time or less jitter? Why nobody (as far as I know) uses PREEMPT_RT in critical applications like airplanes or space applications? May be because of some kind of inertion, or may be RT Linux is not suitable for these applications?

But, on other hand, Linux supports much more of CPU architectures than classic real-time operating systems. And it's much easier to find skilled developer for linux that for QNX.

Thank you.

1

There are 1 answers

0
SK-logic On

PREEMPT_RT does not make your Linux hard real-time, it simply reduces the latency of otherwise blocking operations.

Yet, you can achieve hard real-time performance even on an unpatched Linux, if you isolate a CPU core, set isolcpus=... nohz_full=... rcu_nocbs=... in the kernel boot line, bind your real-time process to this core and set any of the real-time scheduling policies for it (just to hint the kernel), you'll get a bare metal process that will never be interrupted by the kernel or by any hardware interrupts. Now it's up to you to write your code in a hard real-time way - i.e., make sure all the operations are predictable, make sure not to use any system calls, make sure to pre-allocate and pin all the memory, etc.

It is not an OS that makes your system hard real-time, it's your user-space code responsibility.

Linux (even unpatched) is widely used in hard real-time applications, such as high-frequency trading, robotics, aerospace, automotive.