Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Operating Systems Software Linux

Linus Pooh-Pooh's Real-Time Patch 262

An anonymous reader submits "Speaking with CNet via email, Linus Torvalds appears to be in no hurry to accept the latest real-time patches from embedded specialist MontaVista into the mainstream kernel, at least not "at this time." Nontheless, MontaVista's new open-source real-time Linux project could broadly expand commercial opportunities for the open source OS, especially in telecom initially, where real-time Linux will likely play on "both ends of the wire." For example, Linux is already making progress in smartphones."
This discussion has been archived. No new comments can be posted.

Linus Pooh-Pooh's Real-Time Patch

Comments Filter:
  • Better link (Score:5, Informative)

    by Anonymous Coward on Wednesday October 13, 2004 @04:49PM (#10517285)
    Direct link to they story. [com.com]
  • RTOS (Score:4, Informative)

    by darth_MALL ( 657218 ) on Wednesday October 13, 2004 @04:51PM (#10517309)
    I learned something new!
    Real Time Operating Systems. [wikipedia.org] Now you know!
  • Re:Patents ? (Score:5, Informative)

    by d_jedi ( 773213 ) on Wednesday October 13, 2004 @04:54PM (#10517356)
    RTFA.

    A hard realtime operating system is one where calls to the operating system are guaranteed to be executed within a certain timeframe.
  • by Elwood P Dowd ( 16933 ) <judgmentalist@gmail.com> on Wednesday October 13, 2004 @04:58PM (#10517416) Journal
    He might not be in a hurry, but I'd be surprised if he doesn't realize how this could help Linux.

    I'd be shocked if he didn't realize exactly how this patch would impact Linux. From the article:
    "Almost nobody wants hard real-time, even in embedded devices," Torvalds said in an e-mail interview. Adding the feature makes the operating system more complex and burdens the process of "locking," in which the operating system assures that different processes don't step on each others' toes when vying for the same resources.


    Asked whether MontaVista's proposed software could be accepted into the main kernel, he said, "I personally think it's too intrusive, at least at this point," though it might be possible to merge the patch into the kernel in smaller pieces.
    Iduno what else there is to discuss...
  • From LKML (Score:4, Informative)

    by OverlordQ ( 264228 ) * on Wednesday October 13, 2004 @05:03PM (#10517477) Journal
    Dunno if this is even slightly relavent at all but this is from one of the other people doing Prempt things with the kernel.

    finally, i went for correctness primarily, not latencies. I checked
    out the MontaVista patches and they categorize roughly 30 spinlocks
    as the ones that are necessary to be 'raw'. Unfortunately this is
    inadequate, my patch excludes 90 such locks and it's still probably
    not a 100% correct conversion. The core kernel needs changes in the
    locking infrastructure to get rid of most of the these 90 non-mutex
    locks.
  • Re:Patents ? (Score:4, Informative)

    by pavon ( 30274 ) on Wednesday October 13, 2004 @05:09PM (#10517533)
    Uhm, no. He has given an irrevocable, royalty-free licence [fsmlabs.com] for it's use in GPL'd software. Montavista RT Linux is GPL'd. Besides if you read the patent you will see that it is for something that has nothing to do with Montavista's code. Yodaiken's approach was to run the linux kernal as a process of a smaller realtime kernal, and it is that technique that he patented. Montavista is modifying the Linux kernal itself to be run-time, which is a much more difficult task, and would not infringe on this patent whatsoever.
  • by dominator ( 61418 ) on Wednesday October 13, 2004 @05:10PM (#10517544) Homepage
    From the email threads and writeups on KernelTrap, it seems as though Linus (and his Lieutenants) have some issues with the invasiveness and maintainability of the patch, which are reasonable concerns from the maintainers.

    Ingo Molnar - a RedHat employee/kernel hacker - has some patches that are similar in scope but different (and most likely preferable from a performance and maintainability viewpoint) in approach.

    Read about them here and form your own opinion:

    Linux: Real Time Kernel Prototype [kerneltrap.org]

    Linux: Realtime Preemption [kerneltrap.org]
  • by grunt107 ( 739510 ) on Wednesday October 13, 2004 @05:25PM (#10517691)
    Having smart appliances and energy controls securely networked would be a boon to Linux. The real-time kernel would allow speedy monitoring of these type of devices.
  • by tchuladdiass ( 174342 ) on Wednesday October 13, 2004 @05:42PM (#10517872) Homepage
    Actually, it does exist, sortof. If you look at how a Sharp Zaurus sl-5500 is set up, you have 64 meg of ram which is split by the kernel, part of which is used as ram and part is mapped as a block device. This second part survives system reboots and resets (but goes away once the internal battery dies).
  • Re:Patents ? (Score:4, Informative)

    by tchuladdiass ( 174342 ) on Wednesday October 13, 2004 @05:44PM (#10517898) Homepage
    Shared libraries also save ram -- multiple programs using the same shared library all point to the same copy that is in memory. Which also ends up giving a speed boost (more memory free).
  • Answer: (Score:5, Informative)

    by warrax_666 ( 144623 ) on Wednesday October 13, 2004 @05:48PM (#10517945)
    Is the maintenance really that much more challenging?

    Yes. All the other obscure things which only 0.1% of everybody uses, they are small isolated pieces of code (like some random driver). What we're talking about here is adding lots of highly non-trivial code to the core of linux (you know the kernel/ subdirectory of the kernel source) which only 0.01% of people will actually need/use. So, yes.

    I also think it would be quite arrogant of the RT people to expect this to be added without serious thought (and possible reworking). (NOTE: I'm not saying they do/did expect it to, just that it would be arrogant to do so)
  • by Animats ( 122034 ) on Wednesday October 13, 2004 @06:00PM (#10518084) Homepage
    This is where the Linux architecture, with drivers in the kernel, really bites you. Because all the drivers have to be made preemptable, too. This is at odds with the traditional UNIX "top and bottom" driver architecture, with the "top" running as a process and the "bottom" running at interrupt level.

    If you want hard real time and protected mode, you need an architecture like that of QNX [qnx.com], where almost everything runs in user space. File systems, drivers, and networking are all user programs, intercommunicating by message passing. The kernel only handles CPU dispatching, memory management, and message passsing.

    In an architecture like that, everything in user space is preemptable, without any extra work in the system services. There are no long latencies in the QNX kernel; they were all taken care of years ago.

    As Linus points out, though, few consumer embedded devices really need hard real time. Most media-related stuff can paper over delays with buffering. A classic comment is, "You run your web server on Linux. You run your nuclear reactor on QNX".

    Automotive systems, though, really need it. QNX is big in that market.

  • LKML reference (Score:4, Informative)

    by SmileR.se ( 673283 ) <smiler@GAUSSlanil.mine.nu minus math_god> on Wednesday October 13, 2004 @06:00PM (#10518088) Homepage
    Here [theaimsgroup.com] is the LKML thread discussing this (including explanation of why it isnt accepted into mainline).
  • by bfields ( 66644 ) on Wednesday October 13, 2004 @06:14PM (#10518196) Homepage
    Historically, Linus has never liked merging in great glops of code that touch the kernel in many places. It is disruptive to his maintenance of the kernel and it is disruptive to his lieutenants and their sub projects. The article even hinted at how Linus expects those with a major patch like this to handle things. Montavista needs to break this up into bite size chunks that can be slowly merged into the kernel and gives everybody time to get up to speed.

    Note also that the patch hasn't really even been submitted for inclusion. The Montavista people posted it to LKML with a lot of warnings, making it clear this was intended as a way to get early feedback on the direction of their project, rather than as an example of a finished implementation.

    So the slashdot headline is more than a little misleading; everybody agrees this is early in the process, and it's no suprise no-one's rushing to apply the patch.

    --Bruce Fields

  • by DAldredge ( 2353 ) <SlashdotEmail@GMail.Com> on Wednesday October 13, 2004 @06:33PM (#10518384) Journal
    Brain Surgery (Simple Way)

    1: Cut Head Open
    2: Poke brain with stick
    3: Close Brain.

    It's just a little harder than you make it out to be. Look how many of the subsystems have to be touched by this driver.
  • Re:Linus is right. (Score:3, Informative)

    by reynaert ( 264437 ) on Wednesday October 13, 2004 @06:34PM (#10518399)
    Aren't they just being good citizens by offering up their patches for inclusion? You know, like that GPL thing says they should?

    Just to fight this stupid urban myth: The GPL doesn't say that. Please read at least the FAQ [gnu.org]. kthx.

  • Re:Linus is right. (Score:2, Informative)

    by B1gP4P4Smurf ( 790700 ) <rlrevell@joe-job.com> on Wednesday October 13, 2004 @07:02PM (#10518649)
    Come on, MontaVista, don't try to cock things up for the rest of Linux just because you're too lazy to patch the kernel yourself.

    If you read MontaVista's original announcement, it was not posted for inclusion in the mainstream kernel, no one (including MontaVista) is claiming that it is ready. They merely posted their work to stimulate discussion and to avoid duplication of effort. So of course Linus is right, no one ever said it _should_ go in the kernel now or even anytime soon.

    Why was this modded "Insightful", the poster clearly has not bothered to understand the situation.
  • by Latent Heat ( 558884 ) on Wednesday October 13, 2004 @07:06PM (#10518679)
    A spinlock, generally, is a loop of the form

    while (CheckOKtoProceed());

    You see, the program "spins" until CheckOKtoProceed() returns true. The alternative is a call to a Yield(), Wait() or Sleep() function that 1) blocks execution until some condition is satisfied, and 2) tries to yield control to some other pending process while that is happening.

    The trouble with a spin lock is that it hogs the processor. The trouble with the other kind of lock is that it allows another process to proceed, but it may not be safe to allow that on account of a data structure not being in a coherent state of update. A mutex is a kind of lock that by agreement of its use allows only one such process to proceed. A non-mutex lock doesn't offer such protection.

    The argument is that the proposed modification make the kernel much more preemptable and do less spin locking that can kill response, but each element of the proposed modification would need to be checked and tested very carefully that after the change there aren't issues regarding the protection of data structures from multiple processes that could change it along with all kinds of mind-bending subtle bugs that can arise.

  • by SlowMovingTarget ( 550823 ) on Wednesday October 13, 2004 @08:04PM (#10519103) Homepage

    Actually, the article hints at Linus' mastery of the issue by clueing the reader in on a few consequences of hard real time systems. The problem is that while the OS would be capable of guaranteeing a response within tens or hundreds of microseconds, the overall response time of the system is reduced. Linus is quoted as saying he believes most people, even in the embedded space, don't want this as a standard feature of the OS. This is because there's a comparatively easy fix for getting quick response times: over-provision the hardware.

    For HRT systems, however, it's not good enough that the response time is "probably good enough, most of the time." HRT systems require a guarantee, and that guarantee has a net effect of slowing down the system.

    Compare it to "guaranteed-secure" encryption. It's possible (quantum encryption), but it requires a physical fiber connection (a polarized light-pipe) and some serious detection hardware.

    The article goes on to say that Linus may consider putting pieces of the patch into the kernel in the future.

  • by Short Circuit ( 52384 ) * <mikemol@gmail.com> on Wednesday October 13, 2004 @08:13PM (#10519187) Homepage Journal
    Every PC has a small amount of writable NVRAM...it's where my CMOS settings are stored. If you look at the Linux kernel configuration, there's an option to allow writing to this area of memory.

    However, it goes away if your CMOS battery dies. (I believe it's SRAM based.)

    I suspect you're thinking of FLASH memory, which isn't as fast as SRAM, or, generally, even DRAM.

    Here's a good overview [arstechnica.com] on DRAM and SRAM, if you're interested.
  • Re:Alternatives? (Score:3, Informative)

    by Voivod ( 27332 ) <cryptic.gmail@com> on Wednesday October 13, 2004 @09:17PM (#10519640)
    Montavista's approach just involves patching the standard kernel to try to improve its behavior. This gets you soft real-time, but getting provable hard real-time is tough via this route due to the complexity of the kernel.

    RT-Linux (and RTAI which is roughly based on RT-Linux but offers a different API) is very different. It runs as a hard real-time micro-kernel which takes over your system and then runs all of Linux as a thread. When you run your hard real-time code it runs in that micro-kernel space rather than Linux user or kernel space. All of Linux gets preempted by your software.

    Here [disca.upv.es] is a great article covering this subject in more detail with tons of links.
  • by swillden ( 191260 ) * <shawn-ds@willden.org> on Wednesday October 13, 2004 @10:21PM (#10520002) Journal

    This is where the Linux architecture, with drivers in the kernel, really bites you. Because all the drivers have to be made preemptable, too. This is at odds with the traditional UNIX "top and bottom" driver architecture, with the "top" running as a process and the "bottom" running at interrupt level.

    Actually the Linux architecture isn't as bad as you imply in this respect. Although Linux does follow the traditional top/bottom separation (though in Linux terminology, at least, the "bottom" half is the part that runs in a kernel thread and the "top" is at interrupt level), the fact that the kernel itself is now preemptable means that the bulk of driver code is preemptable.

    The code that runs at interrupt level is not preemptable (except by non-maskable interrupts), but it is kept as tiny as possible. The "bottom half" code (implemented using "tasklets" these days) is all fully-preemptable except where it explicitly turns off preemption. Those sections are gradually being eliminated. In addition, low latency work is finding and eliminating sections of code where the kernel does any kind of extended processing without scheduling.

    This doesn't mean that Linux is a RTOS, but it's a lot closer than you'd expect of a mainstream OS, and it's getting better all the time. QNX has a non-preemptable kernel so lots of stuff has to be in userspace to be preemptable. Linux leaves it in the kernel, and preempts it there. Same net effect.

    There are no long latencies in the QNX kernel; they were all taken care of years ago.

    Linux can't say this, of course, but it's getting there and will probably be able to make the same claim in a few years.

    You run your web server on Linux. You run your nuclear reactor on QNX

    And Linux may never be the best choice for hard real-time. But it will certainly be a reasonable choice, soon.

"Engineering without management is art." -- Jeff Johnson

Working...