|
|
Subscribe / Log in / New account

The future of the realtime patch set

By Jake Edge
October 21, 2014

Linux Plumbers Conference

In a followup to last year's report on the future of realtime Linux, Thomas Gleixner once again summarized the status of the long-running patch set. The intervening year did not result in the industry stepping up to fund further work, which led Gleixner to declare that realtime Linux is now just his hobby. That means new releases will be done as his time allows and may eventually lead to dropping the patch set altogether if the widening gap between mainline and realtime grows too large.

Gleixner was speaking at the realtime microconference that was part of this year's Linux Plumbers Conference (LPC). Much of what he had to say was a reprise from earlier in the week when the Real Time Linux Workshop (RTLWS) was held in Düsseldorf, Germany at the same venue as LPC. In effect, his October 16 LPC talk was a recap of the discussion from RTLWS.

Status

[Thomas Gleixner]

He started with a brief report on the status of the patches themselves, along with what needs to be worked on to move more of the patch set into the mainline. At RTLWS, they came up with some "easy things to go upstream", including some code that avoids the "complexities of workqueues", he said. The discussion also resulted in some plans to change some of the patches from last year so they can go upstream as well.

Maintaining the patch set takes a lot of time and effort. But it has also led to improving the quality of the mainline kernel over time. Another effort could lead to similar results, he said: annotating the various uses of the preempt_disable() call. Those calls are made to protect some kernel data structure, but it is not at all clear what they are protecting. That turns them into a "per-CPU BKL [big kernel lock] that is painful to understand".

For the realtime patches, sections where preemption is disabled need to be made as small as possible, but that is difficult to do if it is unclear what is being protected. Currently, developers creating patches for performance improvements often disable preemption, but do not care that it has an impact on the out-of-tree realtime patch set. It is likely, though, that annotating those uses in the mainline will not only help realtime, it will find bugs of various kinds as well.

People have asked over the years how they can help with realtime, Gleixner said, but there isn't a simple answer to that. He cannot just assign people to work on certain pieces. Instead, interested people need to find some part they are interested in, understand it, and then start sending patches and handling the review comments that are generated. It is a matter of new people catching up "with the knowledge of people doing it for ten years".

In many cases, adding realtime patches to the mainline is a matter of enabling certain features, then "see what explodes and then figure it out and fix it", he said.

Success and disaster

Realtime Linux is both a success and a disaster, Gleixner said. It has proven that it is possible to turn a general-purpose operating system (OS) like Linux into a realtime OS, which was something that many academics said couldn't be done. Ideas from Doug Niehaus in the 1990s ended up in the realtime patches ten years later, though there are still some of those ideas, like proxy locking, that have not yet been tried.

It is also a success because it has made the Linux mainline into "a better place", he said. There are a number of features that came from realtime and made their way into the mainline, including high-resolution timers, the foundations of the "nohz" (tickless) patches, threaded interrupt handlers, generic timekeeping, real mutexes, and so on. In addition, the "lockdep" locking validator has helped many kernel developers understand how locking should be done.

On the disaster side, though, is the lack of funding to actually complete the project. There has been a lot of work put into getting the realtime patches upstream. That is partly the "fault" of the US Navy, which noted in the contract that started the realtime effort that all of the work should be upstreamed on a "best effort basis". But projects go away and budgets dry up, Gleixner said.

In five years, the realtime project has gone from a "moderately lively" community-style project to roughly one-and-a-half people working just to keep it alive. The maintenance of the patch set is "not fun", with its six-month development cycle, followed by six months of stabilization. Now the funding has essentially "dried up to zero".

Earlier in the microconference, there had been several indications of use cases where realtime will be used in products. But there is (seemingly) no interest from the industry to keep the project alive. That is "disturbing", Gleixner said.

There are a number of "well-funded and vibrant projects" out there, but there are others that have no funding even when they are widely used. He pointed to projects like Apache and the TYPO3 content-management system as examples of the former. Those kinds of projects are used by new companies that are interested in keeping the projects alive because it is part of their business model.

On the other hand, the typical realtime use cases, such as embedded, automotive, and automation, are from companies that build machines. So the hardware is where they think the value is, Gleixner said. Lots of the value is actually in the software, but companies that do "mechanical stuff" often don't see that. Or at least that is his theory.

The Linux Foundation (LF) and the Open Source Automation Development Lab (OSADL, which organizes RTLWS each year) have both been trying to drum up funds for the last year or more without success. They are trying to get companies to collaboratively provide money or capable developers. There was some tentative interest, but nothing really came of it, he said. He wondered if the industry was treating it like the "Mikado game", where "whoever moves first, loses".

Realtime as a hobby

So, he has concluded that he will be working on the realtime patches on a "hobbyist basis". He needs to work on things that bring in money for him and his family; the realtime work evidently does not fit the bill. He will be working on the 3.16-rt patches in his hobby time, though he noted that he does have other hobbies too.

He has received email from around two dozen companies asking for a schedule for the 3.16-rt release because they need to make product plans. He has responded by telling them that there is no budget and asking if they want to help. He got different types of responses, he said. Some didn't reply at all, which he called "honest". Others said they had no money. It is "crazy" to build a product around a technology and to have no budget to work on it, he said. Others said they would be building their products around the 3.12-rt kernel.

While it is a hobby project as of now, that can change, but it is up to those who want to see that happen to make it happen. The LF and OSADL are still working on it, so interested parties should contact them.

He also noted that if funding takes too long to materialize, the realtime project will be harder to restart. There is a gap between mainline and realtime that grows over time. The scalability and performance improvements flowing into mainline are "massive", he said. Those developers often come up with solutions that are "horrible for realtime". Since the realtime patches are out of the mainline, there is nothing to stop those kinds of changes being made.

There are both technical and political problems to be solved before the remaining realtime patches can be merged into the mainline. Both types of problem can be solved, Gleixner said. Linus Torvalds is willing to merge realtime patches, as long as they don't interfere with the rest of the kernel core. But, before he does so, he also wants to see some organization with a long-term interest in supporting and maintaining the realtime code.

Patches for realtime are quite different than some random driver or filesystem; those can be removed or ignored if they stop being maintained. But realtime is "a different beast" as it changes the core kernel code. It also "causes kernel developers to think more", which is a good thing, he said.

The industry appears not to have heard the call from a year ago, so it may be optimistic to think that will change now. The future of realtime Linux may be fairly bleak. It will be unfortunate if things continue down their current path and companies realize in a year or two that they need the hardware support or other features from a 4.4 kernel, say, but also need the latency guarantees that the realtime patches provide. It could quite possibly be far too expensive to try to pick up the project and move forward at that point.

[ I would like to thank the Linux Foundation for travel assistance to Düsseldorf for LPC. ]


Index entries for this article
KernelRealtime
ConferenceLinux Plumbers Conference/2014


to post comments

The future of the realtime patch set

Posted Oct 27, 2014 7:16 UTC (Mon) by speedster1 (guest, #8143) [Link]

Disappointing to see this... why doesn't the Linux Foundation step in here? This seems like a good investment for those who actually have funds available for improving Linux!

The future of the realtime patch set

Posted Oct 27, 2014 8:29 UTC (Mon) by liam (guest, #84133) [Link] (4 responses)

Always great to see projects that improve the quality of the Linux kernel getting their due.
So, it looks like one area where Linux will never catch up to Solaris will be in its ability to provide latency distributions. Yup, apparently Solaris has had real-time capabilities since 1993.

Solaris realtime OS?

Posted Oct 27, 2014 23:57 UTC (Mon) by vonbrand (subscriber, #4458) [Link] (3 responses)

In 2000 Linux was so much faster on the same machine (SPARC) than Solaris du jour it was not funny anymore. Real time it wasn't, not by a very long shot.

Solaris realtime OS?

Posted Oct 28, 2014 0:33 UTC (Tue) by liam (guest, #84133) [Link] (2 responses)

Who said anything about faster?

Solaris realtime OS?

Posted Oct 28, 2014 0:58 UTC (Tue) by dlang (guest, #313) [Link] (1 responses)

Anything can be "real time" if the deadlines are long enough.

And if the system isn't fast enough to get the work done, it's got no chance to be "real time"

Solaris realtime OS?

Posted Nov 4, 2014 0:50 UTC (Tue) by liam (guest, #84133) [Link]

I'm not sure you're being completely genuous with that reponse.
RT certainly doesn't necessarily mean high performance (rarely, in fact, but not impossible in certain circumstances as, iirc, thomas gliexner has previously mentioned that he expected the preempt-rt network stack to provide even more throughput than mainline---I don't think this ever came to pass), or very short interrupt handling, but it does mean that you can offer guarantees of service, which mainline linux can't offer 100% of the time (always ignoring hardware failure).
Unfortunately, solaris has long had the advantage of extensive, and cheap, tracing, and have used this to be able to track down sources of excessively long preempt-disable.
LITMUSrt has a similar facility, but not the resources, or the purview, to do what solaris was able.
Your last line isn't applicable to the topic at hand, though it is certainly true in so far as it must be true.

The future of the realtime patch set

Posted Dec 19, 2014 7:34 UTC (Fri) by WMW (guest, #100296) [Link]

Many Thanks to the people who have done a very good job with PREEMPT_RT so far.

A reason why nobody wants to fund the further development may be, that the realtime patches are deeply integrated into the linux kernel and no one has control over linux kernels further directions. From the point of view of machinery builders the claim "Linux for the desktop" sounds like poison for real-time applications. Otherwise machinery builders have to deal with functional saftey and therfore with validation and verification of the OS used. Very difficult with 17 million LOC of kernel. They appreciate small rt kernels.

Nowadays there are better solutions out. Multicore SoCs are very cheap. So it seems better to partition the multicore for mission critical real-time, safety and linux applications. You can use unmodified mainline linux if you choose a core with hypervisor. Particulary if you have a product life cycle of 10 to 25 year, which is very common in machinery industry, this promises a clearly better maintainability.

I'm sorry to say this, the rt patch set is a really nice und sophisticated piece of software but has limited value for machine and machinery builders. It may be well suited for gadgets, but who needs real-time there?

There is definetely no market and therefore no funds for real-time patch set.

The future of the realtime patch set

Posted Feb 28, 2015 10:54 UTC (Sat) by kramlie (guest, #101239) [Link]

So LF and OSADL are looking for companies to fund the project, but what about donations from users? Of course they can't individually provide the money that a company can, but put together it might add up. The RT patch set has many users, for instance in the audio production scene.

Personally I'd very much like to contribute, and a simple donation button would make it easier.


Copyright © 2014, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds