By libbyclark
When embedded projects call for for a real-time operating system, Linux developers often turn to PREEMPT-RT, the real-time kernel patch, to get it done.
“The PREEMPT_RT patch (aka the -rt patch or RT patch) makes Linux into a real-time system,” said Steven Rostedt, a Linux kernel developer at Red Hat and maintainer of the stable version of the real-time Linux kernel patch.
The thing is, in most cases real-time requirements on embedded projects can be met without turning to a real-time operating system, he said via email. To developers, a real-time system “does what you expect it to do when you expect it to do it.” That’s all.
“It’s about no surprises,” he said last month in his “Inside the RT patch” presentation at the Embedded Linux Conference (see the slides or video, below).
That means depending on the project’s requirements, any OS can be considered real-time. So when is the RT patch needed?
Here Rostedt discusses when to use a RTOS; compares the RT patch with mainline Linux; defines “hard” vs. “soft” real-time requirements; tells developers how to get started with the RT patch; and estimates when he expects PREEMPT-RT to be fully incorporated into the mainline Linux kernel.
As Dave Stewart said in an ABS panel discussion, people often assume that embedded means real-time but that’s not always the case. He said, “There’s been a dawning realization that you can achieve the vast majority of what you need to with embedded without a classically-oriented real-time system.” Do you agree?
Steven Rostedt: Yes. In fact, a lot of people I’ve talked to think they need real-time for their work when they actually do not. One of my colleagues a long time ago stated that all operating systems are real-time. That is, they all have some kind of deadline, even Windows. If you hit a key and the computer doesn’t respond in say 5 minutes, you are likely to throw the computer out the window. It failed to meet its deadline. When your deadlines are big enough, pretty much any operating system will do.
Of course there’s caveats to this rule.
When and how does real-time Linux come into embedded development?
It all comes down to what your requirements are. An ATM probably doesn’t require a real time operating system, because it’s not too hard to create code that would let it make its deadlines. It just needs to be clean (non buggy) code, not real-time.
Now, if your embedded device has some “must have” deadlines to respond to then the PREEMPT_RT patch would probably be sufficient. I’ve heard that some of the Garmin navigational devices run with Linux patched with the PREEMPT_RT kernel.
What PREEMPT_RT gives you over the normal kernel is not only faster response times, but more importantly, it removes all unbounded latencies. An unbounded latency is where the amount of delay that can occur is dependent on the situation.
For example, with unfair reader writer locks, where the writer has to wait for there to be no readers before it can take the lock. Because new readers can continually take the lock at any time …read more
Source: FULL ARTICLE at Linux Foundation
