NASHUA, N.H. The debate over how best to outfit Linux for real-time embedded duties has shifted gears, with the recent decision by Linux heavyweight Red Hat Inc. to use Finite State Machines Labs' RTLinux technology as its standard approach to hard real-time application requirements. FSM Labs (Socorro, N.M.) and Red Hat (Durham, N.M.) have signed a memorandum of understanding covering cross-promotion, resale and joint development.
The move heats up the debate over whether it's better to enhance the real-time capabilities of the Linux kernel itself the approach of Red Hat rival Monta Vista Software Inc. or to use a separate real-time kernel, like RTLinux, in conjunction with Linux. Unlike Linux itself, RTLinux is based on a patented technology and is not open-source.
At the heart of the issue is the question of maintaining the "purity" of the popular open-source Linux operating system.
Monta Vista's approach sticks with the actual Linux kernel, tweaking certain aspects of symmetric-multiprocessing Linux for use in real-time applications. As a result, applications written for Linux even real-time applications can run directly on it.
The same isn't true for RTLinux. RTLinux is a hard real-time kernel designed to run concurrently with a general-purpose operating system (OS) such as Linux. In the dual-kernel architecture now endorsed by Red Hat, time-critical "real-time" tasks are serviced by RTLinux with negligible interference from the routine system functions performed by the general-purpose Linux OS.
The idea behind the RTLinux solution is that very few tasks need to be done with extremely high precision, said Joe DeBlaquiere, product manager for embedded Linux at Red Hat. "Those individual tasks themselves break down into very simple tasks to run on the Posix-based RTLinux API [application programming interface], and then everything else operates within Linux," he said.
"In other words, you're not spending a lot of time trying to maintain a separate set of patches," he said, calling this one advantage "of keeping the real-time kernel separate from Linux."
DeBlaquiere also said that Red Hat is "committed to making any changes that we make [in Red Hat Linux] be part of Linux, and working within the process of the Linux kernel itself."
Monta Vista, too, is attempting to have its real-time approach made part of the official Linux standard. "We want to see Linux succeed broadly," said Kevin Morgan, vice president of engineering. "And we think this kind of improvement will help Linux maintain and enhance its competitiveness against other operating environments. We think it should go into the 2.5 version of Linux."
Monta Vista contends "that a kernel-substitution strategy like RTLinux, RTAI and some commercial strategies that are out there are not Linux, for the basic reason that you're not following a Linux programming model when you employ them," said Bill Weinberg, director of marketing at the Sunnyvale, Calif., company.
By contrast, Weinberg said, Monta Vista's approach to real-time Linux doesn't alter the APIs of the programming model, so users can write user-level applications with real-time characteristics and not change their disciplines. Also, he said, it leverages technology that's already in the corpus of Linux, in particular the symmetric-multiprocessing technology.
Monta Vista alters the "spin locks" in SMP Linux for more general preemption use. The spin-lock definitions are changed into a software construct that basically says, "while I'm in this region, don't preempt me."
The changes to the Linux kernel to create this preemptible mode are very small, said Morgan. "All that's needed is a redefinition of the spin locks, small modifications to the interrupt handler, small modifications to the scheduler, and we're there," he said. "The result is fast response to high-priority processes. All we do is make Linux respond faster."
While conceding that point, Red Hat's DeBlaquiere said there's a broader issue to consider. "If you write things to standard Linux APIs, a large percentage of those APIs are blocking system calls anyway," he said. "In order to craft a real-time application, whether it be on RTLinux or running within Linux or any other model, you've got to tailor your application and make only calls which will not block processes and [which will] be otherwise real-time-compatible."
DeBlaquiere termed the Monta Vista approach "not technically a bad one. The problem," he said, "is that it's just not a manageable source base. The Linux kernel is being issued right now at rate of minor versions every week. They're challenged with basically running to keep all their stuff current with this moving Linux target."
In contrast, he said, Red Hat "is basically standing on top of Linux while it's already moving, and any progress we make going forward, we don't have to run to keep up but rather get to take advantage of all that progress."
Monta Vista has so far had no success in its campaign to make its preemption approach a part of official Linux. But Morgan doesn't see that as a major setback. Monta Vista has productized and shipped the technology, he said, and "moved it across all of our target architectures."
Morgan reported that many of the company's real-time embedded customers say they couldn't use Linux without it. "We're fully committed to it, and whether it goes into the official Linux kernel standard or not doesn't make a whole lot of a material difference," he said.
Nevertheless, the company is keeping up its efforts to officially fold the approach into the Linux kernel. "Our basic perspective is that the improvement we're making in Linux proper is an advantage to Linux across all sorts of target markets," Morgan said. "It even has advantages on the desktop, because the desktop has fundamentally become a multimedia resource."
Standard Linux can't meet the kinds of timing behaviors needed it that multimedia environment, he said, but with the preemption capability it can. It's an improvement for servers for similar kinds of reasons, Morgan added.