LWN.net Logo

Linux in realtime

By Jake Edge
November 28, 2007

The Ninth Real-Time Linux Workshop, held in early November in Linz Austria, provides a look into the current direction of realtime Linux research as well as applications of the technology. LinuxDevices has collected up the available papers from the workshop which make for interesting reading. Roughly half of the papers cover applications, from robotics to train monitoring, while the other half cover realtime development and measuring the impacts of various techniques.

Realtime Linux solutions have branched out quite a bit since the original RTLinux. Because that solution is patented, now owned by Wind River, and largely unmaintained, various other solutions are maturing. In addition, the realtime preemption (RT_PREEMPT) patches are also making their way into the mainline kernel. For "hard" realtime, guarantees must be made about the interrupt (and other) latencies in the system; so far Linux with RT_PREEMPT has not been proven to make those guarantees. It does provide a solution described by some of the authors as "good enough" for many hard realtime applications, however.

Several of the papers covered various aspects of the performance of the RT_PREEMPT kernel. Worst-case latencies for low-end PowerPC and ARM processors (suitable for embedded applications) were measured and reported. Two different clock frequencies were used for each processor to determine if there was a simple relationship between processor speed and latency: "A better realtime behavior cannot be achieved by simply choosing a processor with a higher clock frequency."

Another paper measured the impact of RT_PREEMPT on general system performance to try and gauge the cost of those kernel changes. They found "no significant impact of [RT_PREEMPT] on the general performance of the system unlike the preempt patches of earlier kernel versions." They also measured latencies and jitter to try to determine its suitability for hard realtime tasks, finding that even though there are no guaranteed worst case latencies, RT_PREEMPT kernels are not "definitely unsuitable".

The third paper measuring performance looked at the performance characteristics of an RT_PREEMPT kernel on an industrial controller board. In addition, the measurements were validated using a paint robot. Their conclusion provides a nice summary of the progress the Linux kernel has made for realtime applications:

Linux has for a long time proven that its stability is excellent, and now we see that the real-time performance is really moving towards other commercial real-time operating systems. The ability to be able to run a real-time application on the same processor as other standard applications is a winning combination. This is really what favors Linux as a real-time operating system compared to other dedicated real-time operating systems.

Research into how to effectively use multi-processor and multi-core systems for realtime tasks was the topic of another of the presentation. LITMUSRT is a kernel modification that implements pluggable schedulers. It was created to test different kinds of scheduling policies to discover which algorithms work best for realtime applications on multiple processors.

An area that generally receives little notice in the realtime community is disk I/O, but a paper presented looks to change that. The authors looked at existing I/O schedulers for realtime systems and found them lacking – the models used are too simplistic and do not take into account prefetching and write-caching. They implemented a more realistic model into an I/O scheduler for RTLinux and report their results.

The XtratuM "nanokernel" is a virtualization solution used in realtime applications. Linux has also been ported to run on XtratuM for the x86 architecture, which allows it to run alongside a realtime OS. Two papers were concerned with XtratuM, one covering a FIFO implementation between XtratuM domains, allowing communication between guest OSes. The other covered porting it to the PowerPC architecture.

PaRTiKle OS is a compatible replacement for RTLinux, allowing applications built for that platform to run unchanged. It uses an entirely different technique, implementing the kernel system calls itself, rather than using the Linux kernel. This makes the connection to Linux a bit tenuous, but because it avoids the RTLinux patents and is LGPL licensed, it may be a useful migration path for RTLinux users.

The participation of Universities at the workshop is something that stands out right away. The vast majority of the papers came from Universities, mostly European – unsurprising given the location – but from China and Mexico as well. LWN raised some questions about the lack of University participation in Linux development back in July, perhaps part of the answer lies in the realtime realm. It is unclear how much of the code will actually reach the mainline, but the number of University participants in the workshop is impressive.

This article just notes some of the papers presented, for those interested, there is much more available. The papers covering various applications where realtime Linux is actually being used are very detailed. We can expect to see Linux used more frequently in these kinds of applications in the future.


(Log in to post comments)

Copyright © 2007, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds