Slashdot Mirror


Preemptible Kernel Patch Accepted

An Anonymous Coward writes: "The preemptible Linux kernel patch that was originally introduced by MontaVista Software and more recently championed by Robert Love has been merged by Linus Torvalds into the main linux development-kernel tree, beginning version v2.5.4-pre6. This adds a far greater degree of real-time responsiveness to the standard Linux kernel, by reducing interrupt latencies while kernel functions are executing. The story at LinuxDevices.com includes comments by Robert Love, and there is also a recent interview with Robert Love about the preemptable kernel here and a whitepaper about the technology by MontaVista here."

352 comments

  1. Wow. by 1010011010 · · Score: 5, Insightful

    I thought that the preempt patch was quite a way from being part of the linus tree. On the other hand, early in a development kernel is probably the right place to integrate it, so that all those device drivers with problems with the preempt stuff (like NE2000, I think) can get fixed.

    --
    Napster-to-go says "Fill and refill your compatible MP3 player", which is a lie. It's not MP3. It's WMA with DRM.
    1. Re:Wow. by digitalunity · · Score: 3, Interesting

      It's really good that it was put in now instead of later. In fact, I really think the new VM should have waited for 2.5 as well. I just couldn't figure out why you'd change such a fundamental piece in the middle of a stable tree! But hey, I don't wear the Linus nametag; not my job.

      This will be a good first step in reducing latency and increasing response time in X and other programs.

      --
      You can't legislate goodness. Let each to his own destiny, by will of his freely made choices.
    2. Re:Wow. by Anonymous Coward · · Score: 0

      Why the one year delay in applying this patch? It was only 50 lines or so.

    3. Re:Wow. by Anonymous Coward · · Score: 0

      Alans Cox already fix NE2000

    4. Re:Wow. by Anonymous Coward · · Score: 0

      Thats a load of FUD. True, 2.4 was never *really stable*, but there were a lot of people using it in production environments. With some of the new features like NUMA support, it was really a requirement on some equipment.

    5. Re:Wow. by Anonymous Coward · · Score: 0

      Yes, I wish someone had told me about the problems with NE2k Cards earlier, after a couple days uptime I was getting worried as to why on a 10Mb/s LAN I was getting 10-20KB/s downloads, I switched back to stock 2.4.17 quite quickly!

    6. Re:Wow. by Anonymous Coward · · Score: 0

      It may be "low-quality" as you put it, but it's still better then 95% of the commercial OSs available! Oh, and Microsoft doesn't fit into that other 5%...

    7. Re:Wow. by Anonymous Coward · · Score: 0

      and it's pure shit compared to *bsd.

    8. Re:Wow. by Anonymous Coward · · Score: 0

      what? you dare question the word of his holiness, Linus Turvaldes?

      His previous explanation was that it didn't fix the fundamental issue (ie - linux sucking ass), it was just a workaround. The preferred solution would be to actually fix the problem.

      I guess since no one fixed the problem in two years, linus has given up hope.

    9. Re:Wow. by kingdon · · Score: 2

      Not that surprising, if I correctly recall Linus's comments at ALS. Although Linus mentioned various caveats with the preemptive kernel patch (some of which are improved in more recent versions of the patch), they didn't really add up to "the whole concept is broken". More like "not for 2.4".

    10. Re:Wow. by Sj0 · · Score: 2

      This is the trippiest AC thread I've ever read!

      for those who don't read at 0, I'll sum the whole discussion down right now.

      person 1: OSS sucks.
      Person 2(re: Person 1): Microsoft sucks. OSS is better.
      Person 3(re: Person 2): Linux sucks. BSD is better.

      So to sum it all up,

      Everything sucks! :)

      --
      It's been a long time.
    11. Re:Wow. by Chromium_One · · Score: 3, Funny

      Yes. It all sucks. As has been said in the past though, there is a certain range of problems for which *nix sucks twice as fast and ten times more reliably than Windows.

      --
      When you live in a sick society, just about everything you do is wrong.
    12. Re:Wow. by snake_dad · · Score: 2

      Well, there's Apple and stuff. But I think they suck. :-)

      --
      karma capped .sig seeking available Slashdot poster for long-term relationship.
    13. Re:Wow. by Tony-A · · Score: 2

      Yep. It's a lesson all right.
      Unstable OSS beats Microsoft.

    14. Re:Wow. by Airline_Sickness_Bag · · Score: 1

      > In fact, I really think the new VM should have waited for 2.5 as well. I just couldn't figure out why you'd change such a fundamental piece in the middle of a stable tree!

      The original 2.4 VM stank. We couldn't run jobs on our beowulf clusters with pre 2.4.10 because it required 30-50% more memory than our nodes had. And adding memory was out of the question - the memory slots were completely filled, and 1GB rdrams were quite pricey at the time. But it runs w/o swapping under 2.4.10.

      -asb

    15. Re:Wow. by WNight · · Score: 3, Informative

      This is actually a problem with the word "stable".

      The even numbered (2.2, 2.4, etc) builds are API stable.

      API stable means that a program you wrote for 2.4.0 would run without change on 2.4.99 because the libraries and system APIs are identical.

      Now, ideally they'd be stable as in not crashing, but that's never going to happen. New testing releases often have problems.

      "But, it's not testing, they released it," you say.

      Did you get a buggy kernel from Redhat, or Debian, or any other distro? Or did you go download it seperately and install it? If so, it's not released for end users.

      This doesn't mean that those kernels weren't buggy, just that they weren't guaranteed not to be.

      Stable is like free, a word with many connotations. In this case is means unchanging, not crash-free. If you want crash-free, simply wait a week and see what people have to say. (You never need a new kernel so badly you can't wait.)

      Anyways, the new VM was a big change, but if the original VM wasn't cutting it, I think Linus did the only thing he could. He wanted 2.4 to be usable (if not perfect) so he swapped out a potentially better VM for a simpler VM that would work now. Otherwise 2.4 would still be unusable for many applications and people who needed it would have to use 2.2.x or wait for 2.6 which is likely quite a ways off.

      Don't forget that changing the VM doesn't change the APIs. A program written for Rik's VM works fine with the AA VM and vice versa.

  2. Pre-empt by aeil · · Score: 2, Interesting

    After watching traffic about this almost every day for several months, I can say that I agree with this inclusion and hopefully some of the Low - Latency patches will make it in as well.

    --
    $home =~ s/work/play/gi; nice -20 run $home;
    1. Re:Pre-empt by Anonymous Coward · · Score: 0

      You're clueless. The low latency patches aren't needed anymore; all they did was adding rescheduling points, and now that the kernel is pre-emptible, it can reschedule at any point.

  3. Nice work by ekrout · · Score: 5, Informative

    But many folks may have no idea what effect preemptability actually has upon a user who uses GNU/Linux. Here's the good news:

    [] Smoother video
    [] Smoother user interface
    [] A seemingly more responsive computer
    [] Overall smoothness in operation
    (reply to this if you'd like to add to my list)

    Congrats to Linus for getting this ready so soon, and to those who helped develop it.

    EricKrout.com :: A Weblog On Crack

    --

    If you celebrate Xmas, befriend me (538
    1. Re:Nice work by Anonymous Coward · · Score: 0


      Congrats to Linus for getting this ready so soon


      Yeah, it only took 2 years for it to get integrated. If MS was that lazy, the slash-shit would hit the fan.

      Oh wait, you said something nice about linus. mod me up, scotty.

    2. Re:Nice work by jsse · · Score: 5, Informative

      Aye, it's sure a great news for *cough* gamers. In the past when we'd like to have a smoother 'mouse' we must change the HZ value in include/asm/param.h from 100 to a higher value(progressive increase the value and recompile kernel until it breaks. ^_^)

      Other archs like alpha use values higher than 100 e.g.

      include/asm-alpha/param.h:# define HZ 1024

      include/asm-ia64/param.h:# define HZ 1024

      You may try it if you aren't going to go to 2.5.x in the near future, but hell, if you don't mind twisting and breaking the kernel by altering the HZ value, why not 2.5.x! :D

      Note: I notice that whenever I talk about changing kernel values the post will be modded redundant. I know a lot of you guys know about kernel insdide out so this might bore you - but come on! I'm sure so many other would be interested in it.

    3. Re:Nice work by Sj0 · · Score: 2


      Yeah, it only took 2 years for it to get integrated. If MS was that lazy, the slash-shit would hit the fan.


      I find that funny. It took MS 5 years to hop on the internet bandwagon. Same with a fully 32-bit OS. 5 years. 2 years looks downright speedy -- and good luck getting MS to integrate somebody elses code into theirs. They *still* haven't fixed the bug in Direct Cable Connection which disallows the use of an ECP cable(which is hella fast.), though a patch for that has been on the internet for almost 4 years now.

      --
      It's been a long time.
    4. Re:Nice work by rhekman · · Score: 5, Informative
      Just to avoid confusion... a few notes about this approach.

      First, for those that didn't get it from the parent post, HZ is a system wide timing value. It has nothing directly to do with the mouse.

      What it does deal with is how many times a second the system's interrupt timer fires. The problem with increasing the interrupt timer frequency is that you waste more time servicing interrupts than doing real work. It may improve interactive "feel" because the timer interrupt will trigger higher priority tasks to be rescheduled more often, but at the price of higher system time and lower "throughput".

      Compared to the preemptible kernel patch, increasing HZ is actually harder on throughput, especially on slower systems. Much work has been done on finding and killing long held locks not covered by the preempt patch (thanks to Andrew Morton and RML), an approach which has been shown to be quite effective. Increasing timer interrupt frequency means you're creating more pointless interrupt load, which goes against the approach and advances of the other low-latency patches.

      There is an interesting discussion of the HZ value and how it effects Linux in a VM at Linux Weekly News and for more arcana check out the high resolution timers project.

      Regards

      --
      I like teamwork. It's easier to assign blame that way.
    5. Re:Nice work by jsse · · Score: 1

      Thank you for such a detail explanation! You deserve all the mod pt I was given! :)

      Yes it's not directly related to my mouse but that's the mouse reponsiveness I'd care in this case(game, game game!). There's always ways to make my mouse smoother by twisting here and there(gotta love Linux).

    6. Re:Nice work by Anonymous Coward · · Score: 0

      This patch proves once again that Linux is the best operating system of them all, even better than Windows.

    7. Re:Nice work by JohnPM · · Score: 1

      I'm sure this is also a good thing for getting more haptics rendering (ie. force feedback rendering, for example) working on linux.

      The challenge with haptics is getting at least a 1kHz frame-rate on force renderings. This requires soft-realtime perfomance at a minimum and is tricky on most platforms.

      --
      Karma police, I've given all I can, it's not enough, I've given all I can, but we're still on the payroll.
    8. Re:Nice work by Anonymous Coward · · Score: 1, Interesting

      Yes, I know I'm pushing my own post, but I'd appreciate it if some moderator would either mod this post up or if someone would post similar information where it will get seen -- there's a lot of misinformation running around.

      As for the "preemptability effect on users". Um...I have to say, not quite. There's a rather large difference between process-level preemptability -- which Linux has had forever...hell, Win95 has had forever -- and kernel-level preemptability.

      The kind of stuff that a user can notice in normal use -- click on a different window in your desktop environment, takes a third of a second to do anything because it wasn't that app's turn to use the CPU -- derives pretty much completely from process level preemptability. In this kind of environment, the CPU is always pegged at 100%, switching between tasks if nothing else. Never happened in Linux. See classic MacOS or Win 3.1 for an example of this.

      Kernel level preemptability exists completely to allow the kernel to switch away from some "long" (please understand that the kernel's idea of "long" is quite different from a human's) operation inside the kernel. These chunks of time are so small that they're really mostly relevant to tasks that need realtime scheduling (or as near to realtime as Linux can do), usually stuff in embedded systems. There are very few things that a desktop user will notice as a result of this patch (aside from probably some instability for a bit until everything gets ironed out). It might fix the polling-the-MIDI-port-makes-the-serial-port-drop-i ncoming-data issue I run into under Linux, but it won't make your windows drag more smoothly.

      This is a good thing, but not nearly as applicable as people are talking about.

    9. Re:Nice work by Sj0 · · Score: 2

      This patch proves once again that Linux is the best operating system of them all, even better than Windows.

      I wouldn't say that, I'm quite partial to BeOS, personally. I know it hasn't a hope in hell of being continued(except through efforts like OpenBeOS), but it's still a truly amazing OS, which can do things which other OSs wish they could do on teh same hardware.

      --
      It's been a long time.
    10. Re:Nice work by Anonymous Coward · · Score: 0

      To summarize what you're saying...

      [] Better computing

  4. This a major achievement for Linux by Khalid · · Score: 1, Redundant

    I have been waiting for this for a long time. I was not even sure whether Linus will ever accept it one day. This is a major achievement for Linux and open a lot of new opportunities in Desktop and Real time applications.

    1. Re:This a major achievement for Linux by Anonymous Coward · · Score: 0

      Linux wins again. Ain't life grand?

  5. Will this apply to X Windows? by BlueJay465 · · Score: 3, Interesting

    I am interested to know if this will make the response time on X86free faster. So far from what I have noticed, comparing the way MS-Windows works where the GUI is running within the kernal, and how X runs non natively. I have seen significant lag between mouse clicks and on-screen response.

    Example. Running XMMS and pushing play on an MP3 the video display and the sound are not synched. I am running a reasonable video card and sound card (Geforce 256 and a SB-Live) and I expect the video to work on the same scale and rate as the audio, like MS-Windows.

    BTW, this has been one of the biggest complaints I have had against X86free and why I haven't completely made the transition to Linux yet. If this patch does in fact improve the response time of X86free, then I would be more likely to use it more often than I use XP.

    1. Re:Will this apply to X Windows? by X-Dopple · · Score: 2, Informative

      I completely agree. This is one of the biggest annoyances I have with Linux: that there is a percievable delay between clicking, say, the "File" menu in a GTK-based app and the contents of the File menu showing up.

      However, I doubt that it's XFree86's fault, as the port of X-Chat (which was built with GTK) to Windows shows the same menu behavior as its Linux counterpart. On Linux, however, IceWM exhibits no menu delay whatsoever.

      Then, of course, you have to take into account if you're running a theme that uses pixmaps. If you're running bubbles-gradient, for example, you're more than likely wasting a horrendous amount of CPU cycles just to highlight a button. Even with fast themes like thinice, the delay is still there.

      It's this kind of clunkiness that makes me wonder how people can use themes like this

    2. Re:Will this apply to X Windows? by sinserve · · Score: 0, Troll

      This must be a bottle-neck in the GTK signal
      routing code; I beleive it could be eliminated with
      some manual optimization (i.e. loop unrolling, and
      inline assembler.)

      file it as a bug, and let the developers take a look
      at it. I am using a GHz machine, so I don't notice
      the 2D math calculations. Or maybe, my monitor/gfx card
      have higher refresh rates.

    3. Re:Will this apply to X Windows? by DrSkwid · · Score: 1

      XMMS consumes up to 10% of my 500mhz p3 with 312 Mb RAM on FreeBSD

      mpg123 with no fancy GUI uses 2% tops

      Windows has spoiled you my friend, aint no need for that fancy shenanigans unless you really NEED a play button to press, myself I just type xm

      I've also got some aliases for volume if I type 50,60,65,70,75,80,85 or 90 they alias to mixer 50:50, mixer 60:60 etc.

      slightly OT but who cares, well not me

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    4. Re:Will this apply to X Windows? by jpt.d · · Score: 1

      I do not know where you get the XCHat thing, i use it in windows and no problems that way.

      --
      What we see depends on mainly what we look for. -- John Lubbock Now search for that bug slave!
    5. Re:Will this apply to X Windows? by Anonymous Coward · · Score: 3, Funny
      myself I just type xm

      I've also got some aliases for volume if I type 50,60,65,70,75,80,85 or 90 they alias to mixer 50:50, mixer 60:60 etc.
      Wow. Welcome to 1973. What's it like back there, caveman? Are you "grooving" to those "funky" "disco beats"?
    6. Re:Will this apply to X Windows? by Anonymous Coward · · Score: 0

      the slow speed gtk menus is actually an intentional design decision.

    7. Re:Will this apply to X Windows? by jaavaaguru · · Score: 1, Interesting

      Windows has spoiled you my friend

      If having fancy graphics makes the Windows ppl switch to Linux, why not let Linux have the fancy graphics, after all a product's goal is to be popular.

      FYI, XMMS uses 2% processor power on my PC, and mpg123 varies from 1 to 2 (Dual Athlon MP 1600+). Only thing I find unresponsive is OpenGL games under X version 4. I should probably be using an X server with 3D acceleration.

      Where Linux (well, the big popular distros anyway) are loosing out is being able to run the graphically intensive stuff on lower spec machines. My Compaq laptop hapilly runs the latest MS bloatware but crawls under RedHat or Mandrake.

      Maybe the pre-emptive kernel will sort this out too :-) *fingers crossed*

    8. Re:Will this apply to X Windows? by Anonymous Coward · · Score: 0

      I too have been spoiled by Windows...is that necessarily a bad thing, I think not. You on the other hand are spoiled, thinking you are the uberh4X0r cause you know stuff that others don't and because Bill is the capitalist he is (and quite successful at it too)

      Linux may be the poster-child for the open source movement, however, it's real performance is sub-par of other operating systems that are retail...after all you do get what you pay for my friend.

      --
      Linus is my bitch

    9. Re:Will this apply to X Windows? by DrSkwid · · Score: 1

      1. I don't use Linux
      2. wasting cpu cycles on XMMS is er, a waste
      3. I've paid more money to Free software than I ever have to non-free (cept games)
      4. IHBT

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    10. Re:Will this apply to X Windows? by DrSkwid · · Score: 1

      why not let Linux have the fancy graphics
      no reason, I use enlightenment after all

      a product's goal is to be popular.
      I think popularity appears lower down the order, behind useful, stable and correct

      loosing out
      hehe they are definately losing the ability to run on my p133 laptop. plan9 would do a better job though, if it supported my laptop's chipset (bah!)

      QNX & win95 certainly run fast enough on it. The real problem with it is using generic vga drivers for X. I was going to go for the SVGA vncclient but first try failed and I lost the will to carry on.

      might be time to put Linux on it (shudder!)

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    11. Re:Will this apply to X Windows? by Anonymous Coward · · Score: 0

      Don't use XFree86 -- use XIG's Accelerated-X (now called Summit 2.0). It's at least 8.42X faster than XFree86's server.

    12. Re:Will this apply to X Windows? by FyRE666 · · Score: 1


      It's this kind of clunkiness that makes me wonder how people can use themes like this [snipped]


      Well, I don't know about anyone else, but I like to know I'm getting my money's worth from my CPU. I've paid out my hard earned cash for my P90 and 16mb of fast EDO RAM, and it's going to damned well work for me - if the openGL 3D spinning CPU usage meter drops below 100% I'm wasting electricity! I want translucent menus, gradients everywhere, and 32bit colour depth on my xterm whether I need it or not. The chicks love it too... probably...

    13. Re:Will this apply to X Windows? by Anonymous Coward · · Score: 0

      Yeah, right. Typical Linux doublespeak. Everything is configurable except speed which is too fast.

    14. Re:Will this apply to X Windows? by Anonymous Coward · · Score: 0

      GTK+ with inline assembler? Glib (which GTK+ uses) has some inline assembler. But somehow I don't see GTK+ ever having it.

      GCC has an automatic loop unrolling flag (-funroll-loops), so I don't think that's much of an issue. It also has automatic function-in-the-same-file inlining (-finline-functions -fkeep-inline-functions), if one is so inclined.

      But those optimizations only go so far. Which is not very far at all.

    15. Re:Will this apply to X Windows? by Anonymous Coward · · Score: 0

      Optimization obfuscates code. Obfuscation and free/open software don't mix. Obfuscate it yourself if you must.

    16. Re:Will this apply to X Windows? by idealego · · Score: 2, Informative

      "where the GUI is running within the kernal" the gui is explorer and it doesn't run in the kernel.

      "and how X runs non natively" huh? you mean in user space. The graphics in windows 2k/xp run in the kernel which is what you actually mean by all this.

      "pushing play on an MP3 the video display and the sound are not synched" This has to do with the sound being buffered in xmms, the video is rendered from samples as they are placed into the sound buffer instead of when you actually hear them. This has nothing to do with anything but xmms.

    17. Re:Will this apply to X Windows? by psamuels · · Score: 1
      Wow. Welcome to 1973. What's it like back there, caveman?

      Dude! You had a computer playing 44kHz 16-bit stereo sound back in 1973? Color me impressed.

      Seriously - what is wrong with typing '80' instead of moving your hand off the keyboard over onto the mouse, moving the mouse pointer to some designated region on the screen, clicking on a small slider icon and dragging it in one direction or the other?

      Of course, if you are one of those people who spend more time with your hand on the mouse than on the keyboard, it may well be a waste of time to try and explain why the GUI isn't the be-all and end-all of HCI. (:

      --
      "How can you claim that you are anti-crack, while still writing a window manager?" — Metacity README
    18. Re:Will this apply to X Windows? by Anonymous Coward · · Score: 0

      Don't be dissin' the funky beats. Word.

    19. Re:Will this apply to X Windows? by Anonymous Coward · · Score: 0
      Huh yourself! Are you trying to tell me that X isn't a Java applet?? And a damn fine one - I might add?

      Oh, Peddle your disinformation elsewhere B0ris!

    20. Re:Will this apply to X Windows? by Anonymous Coward · · Score: 0

      Wow.

      Someone who's going to claim Open Source is inherently inferior in performance.

    21. Re:Will this apply to X Windows? by Anonymous Coward · · Score: 0

      No. I was just saying that open code should not be purposely obfuscated. Some optimization techniques are VERY obfuscating and make code hard to edit. Loop unrolling is an excellent example.

    22. Re:Will this apply to X Windows? by Anonymous Coward · · Score: 0

      And that's typical AC doublespeak.

      Two for two.

    23. Re:Will this apply to X Windows? by Anonymous Coward · · Score: 0

      Sounds like you need OS X, then. :)

    24. Re:Will this apply to X Windows? by Anonymous Coward · · Score: 0

      No, this patch will do nothing towards that, and frankly the problem you're talking about isn't from X.

      Flip *off* the sound server you're using, and decrease xmms' buffer size and your problems will go away. Renicing (eew) esd or (GAAAAAK...*bloated*, slow sound server) artsd to -10 if you *have* to use the thing will help.

      Linux's real problem is the lack of a non-poor software sound mixing solution, which is the reason all these god-awful sound servers are still sitting around. ALSA isn't gonna do it in libasound, sadly enough -- they've decided that software mixing isn't their problem from a technical standpoint. So there's no Linux solution that "uses all available hardware channels for mixing and then falls back to software mixing when those run out".

      Frankly, very very few people need network transparency for their audio (which eats bandwidth, anyway), and using a sound server for any other reason is kind of dumb. It's just an ugly hack that has made more people than you would believe think that Linux latency/XFree86/gaming has major problems.

    25. Re:Will this apply to X Windows? by Anonymous Coward · · Score: 0

      recompile xmms for your processor instead of using precompiled binaries and the 10% goes away.

    26. Re:Will this apply to X Windows? by einhverfr · · Score: 2

      "where the GUI is running within the kernal" the gui is explorer and it doesn't run in the kernel.

      True, but it makes API calls that cause threads to run in server space. Here is where you will get improvements with a preemptible kernel.

      Actually, the Window Manager is Explorer. The Windows equivalent to X-Server is GDI.exe.

      --

      LedgerSMB: Open source Accounting/ERP
  6. Disadvantages by Metrollica · · Score: 2, Informative

    RL: Please summarize the advantages in general, not just for embedded real-time apps, of having the preemptible kernel enhancement included in the kernel. What about any disadvantages?

    Love: I'll start with a quick explanation of how the patch works. Right now, the kernel is not preemptible. This means that code running in the kernel runs until completion, which is the source of our latency. Although kernel code is well written and regulated, the net result is that we effectively have an unbounded limit on how long we spend in the kernel. Time spent in kernel mode can grow to many hundreds of milliseconds. With some tasks demanding sub-5ms latencies, this non-preemptibility is a problem.

    The preemptible kernel patch changes all this. It makes the kernel preemptible, just like userspace. If a higher priority task becomes runnable, the preempt patch will allow it to run. Wherever it is. We can preempt anywhere, subject to SMP (symmetric multi-processing) locking constraints. That is, we use spinlocks as markers for regions of preemptibility. Of course, on UP (uni-processing) they aren't actually spinlocks, just markers.

    The improvement to response is clear: a high priority task can run as soon as it needs to. This is a requisite of real-time computing, where you need your RT task to run the moment it becomes runnable. But the same effect applies to normal interactive tasks: as soon as an event occurs (such as the user clicking the mouse) that marks it runnable, it can run (subject to the non-preemptible regions, of course).

    There are some counterarguments. The first is that the preemptible kernel lowers throughput since it introduces complexity. Testing has showed, however, that it improves throughput in nearly all situations. My hypothesis is that the same quicker response to events that helps interactivity helps throughput. When I/O data becomes available and a task can be removed from a wait queue and continue doing I/O, the preemptible kernel allows it to happen immediately -- as soon as the interrupt that set need_resched returns, in fact. This means better multitasking.

    There are other issues, too. We have to take care of per-CPU variables, now. In an SMP kernel, per-CPU variables are "implicitly locked" -- they don't have explicit locks but since they are unique to each CPU, a task on another CPU can't touch them. Preemption makes it an issue since a preempted task can trample on the variables without locks.

    Overall I think the issues can be addressed and we can have a preemptible kernel as a proper solution to latency in the kernel.

    --



    --Metrollica
    1. Re:Disadvantages by Metrollica · · Score: 3, Informative

      Also look here

      --



      --Metrollica
    2. Re:Disadvantages by Tremul · · Score: 0, Offtopic

      I love it when people get mod'd up as informative when they just reposted parts of the article. I guess they're helping the people who are unable to click on the link. Perhaps we should invent a new mod type. Idiot

      --

      "Can't sleep. Clowns will eat me"
    3. Re:Disadvantages by Anonymous Coward · · Score: 0

      Maybe they don't want to read the whole article.

    4. Re:Disadvantages by dougmc · · Score: 3, Informative
      Another disadvantage ...

      It crashes my machine occasionally. Dual p3/700 (so it's SMP -- which complicates matters.) Without the preempt patch, the box stays up for months at a time. With it, it seems to lock up hard after a few days.

      So far, at least two crashes happened while burning a CD. I wonder if that's a coincidence ..

    5. Re:Disadvantages by Anonymous Coward · · Score: 0

      MODS:PARENT comment is a troll/redundent/plagerizer

    6. Re:Disadvantages by Anonymous Coward · · Score: 0

      I love it when jealous people post innaccurate flames.

    7. Re:Disadvantages by Anonymous Coward · · Score: 0

      Works beautifully on my dual PIII-550. I couldn't live without it.

    8. Re:Disadvantages by Anonymous Coward · · Score: 0

      Gather info and sumbit the crash info for them. My guess is that you have a driver than is not properly re-entrant.

    9. Re:Disadvantages by dougmc · · Score: 2
      Your guess is probably correct.

      Unfortunately, there's no info to get -- the box is locked solid.

      Maybe there was some dump info sent to a vc somewhere -- but with the screen displaying X, I can't see it.

      This is my work box, so I can't really have it crashing. It's easier to just go back to the stock 2.4.17 kernel and leave it at that. And the preempt stuff doesn't help it much anyways.

    10. Re:Disadvantages by mystran · · Score: 1
      So far, at least two crashes happened while burning a CD. I wonder if that's a coincidence ..

      If you happen to have a IDE drive then at least that stuff is a bit buggy. If you happen to have a USB drive (like I do) that is even worse.

      --
      Software should be free as in speech, but if we also get some free beer, all the better.
  7. Heh. by Murmer · · Score: 0

    Welcome to multiprocessor debugging hell.

    --
    Mike Hoye
    1. Re:Heh. by Anonymous Coward · · Score: 0

      Hell? I disagree. This preemption patch will expose all the existing SMP bugs and bring them to the surface.

  8. Tradeoffs? by chuckw · · Score: 4, Interesting

    You don't get anything for free. What is the tradeoff that occurs when you integrate this patch?

    --
    *Condense fact from the vapor of nuance*
    1. Re:Tradeoffs? by Anonymous Coward · · Score: 0, Funny

      The tradeoff is that porn on Linux will be downloaded 1% slower.

    2. Re:Tradeoffs? by Metrollica · · Score: 2, Funny

      Just so we're sure. Is that "free as in beer" or "free as in free speech"?

      --



      --Metrollica
    3. Re:Tradeoffs? by Max+Threshold · · Score: 1, Informative

      http://www.linuxdevices.com/articles/AT5152980814. html

    4. Re:Tradeoffs? by MrXZY · · Score: 1

      It's been speculated that the preemptive patches might sacrifice data throughput in order to improve latency. But, like other posters have mentioned, you can always turn the preemptive stuff off at compile time.

    5. Re:Tradeoffs? by keeg · · Score: 3, Informative

      The average throughput drops. In other words, it's not something you use on a server, but it's very useful for embedded devices, where latency is important. It's also very nice for desktops, been using it for ~2 months now. YMMV, but my desktop is a _lot_ smoother.

    6. Re:Tradeoffs? by Anonymous Coward · · Score: 0
      Each preemption causes a context-save of CPU variables for the kernel task (since the preempting task will step on those cpu variables). This context save isn't free.

      Soooo, long story short: if you get a _lot_ of preemption, you will notice a performance hit.

    7. Re:Tradeoffs? by megabeck42 · · Score: 5, Informative

      With this patch the kernel becomes preemptible - meaning, other kernel tasks can stop the current one from executing, execute, finish, and allow the stopped tasks to finish.

      Net effect - expensive operations can be suspended for user interactiveness. Can this impact performance, Yes. Noticeably? No.

      If you're running a big-ass server, it's probably head-less, anyways - and you won't have any large, interactive processes preempting the kernel for smoothness.

      If you're running a workstation, this means that X won't bog down as much when you're running those huge simulations, compiles, etc.

      If you're on an embedded device, you can use this to try and get real-time responsiveness. (perhaps not ideal, but, in an embedded situation you have enough control that if you need a better real-time guarantee, you have other options (e.g. rtlinux).)

      If you're on a modest, consumer PC - X won't suck as much.

      All in all, this is a good idea. In theory, you lose some efficiency making several thousand context switches/second, but that's the price you pay for multi-tasking. Yeah, certain kernel operations may take longer, but, you get a better responsiveness, which - for most people, is a good thing. Most interactive individuals are seldomly pegging their processor at 100% utilization for any worthwhile period of time. (Games are an exception.)

      This is good stuff.

      --
      fnord.
    8. Re:Tradeoffs? by Max+Threshold · · Score: 1

      Damn line breaks. Remove that space.

    9. Re:Tradeoffs? by sean23007 · · Score: 1, Redundant

      Here is a comment by one of the MontaVista people addressing this very issue: http://www.linuxdevices.com/articles/AT5152980814. html

      Thought this might be interesting.

      --

      Lack of eloquence does not denote lack of intelligence, though they often coincide.
    10. Re:Tradeoffs? by sydb · · Score: 5, Insightful

      Aside from the technicalities of this particular patch, your assumption that you're going to lose something when you apply a beneficial patch because 'you don't get anything for free' is, despite appearing mature and clueful, way off mark.

      The cost doesn't have to be borne by the end user. The cost can be developer time / clues. In the Free Software world, you do get that for free.

      --
      Yours Sincerely, Michael.
    11. Re:Tradeoffs? by megabeck42 · · Score: 1

      Each context-switch also requires a context save, restore, cache-flush etc. The damage isn't too much worse than a context-switch, which happens thousands of times a second, anyways; but, it can impact maximum throughput, because the preempted task will be postponed.

      --
      fnord.
    12. Re:Tradeoffs? by ThatComputerGuy · · Score: 1, Interesting

      That is correct, in theory. However, as RML and others have stated, in practice, even applications where throughput is more important than response the pre-empt patch ends up helping overall.

      Keep in mind that's in _most_ cases, so preempt kernel is not exactly for everyone, but it will help a lot of people.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    13. Re:Tradeoffs? by Some+Dumbass... · · Score: 1

      Yes, but pornographic movies will play SO much smoother...

    14. Re:Tradeoffs? by B1ood · · Score: 3, Informative

      This is an option in the kernel. if you aren't compiling a kernel for a desktop box, chances are you won't want to enable this in the first place. therefore your net loss is zero.

      --
      Note to self: pasty-skinned programmers ought not stand in the Mojave desert for multiple hours. -- John Carmack
    15. Re:Tradeoffs? by Anonymous Coward · · Score: 0
      The cost doesn't have to be borne by the end user. The cost can be developer ... clues. In the Free Software world, you do get that for free.
      Well, I'd agree that you get all the developer clues that you pay for, yes. For example:

      Invalid form key!

      Invalid form key: rz1wQF5mud !

      If this error seems to be incorrect, please provide the following in your report to SourceForge.net:

      * Browser type
      * User ID/Nickname or AC
      * What steps caused this error
      * Whether or not you know your ISP to be using a proxy or some sort of service that gives you an IP that others are using simultaneously.
      * How many posts to this form you successfully submitted during the day

      * Please choose 'formkeys' for the category!
      Thank you.
    16. Re:Tradeoffs? by kputnam · · Score: 1, Insightful
      I have read some of the disadvantages already posted, but what about security? For functions like tempnam that create a new file in /tmp with a random name and then return the file handle, I thought these must be uninterrupted, or you end up doing the samet thing as:

      $random = md5(microtime());
      if (!file_exists("/tmp/$random")
      $fd = fopen("/tmp/$random", "w")
      ...

      The problem is the symlink/race condition issue that prompted the need for a kernel-level function. Or is there a way to prevent that from being preemptable?

    17. Re:Tradeoffs? by chuckw · · Score: 2, Troll


      despite appearing mature and clueful, way off mark.


      No, despite trying to sound like the wiser one, you are way off the mark. If this was just a patch that unplugged a logjam it would have been applied a very long time ago. No, it took time because there were tradeoffs. Yes, those tradeoffs may not be entirely tangible or even noticeable by the end user, however there *are* tradeoffs.

      For more proof, I'll direct you to the large number of clueful responses to my original question.

      --
      *Condense fact from the vapor of nuance*
    18. Re:Tradeoffs? by sydb · · Score: 2

      My very first words: "Aside from the technicalities of this particular patch".

      Did you read them?

      --
      Yours Sincerely, Michael.
    19. Re:Tradeoffs? by chuckw · · Score: 2

      Absolutely read them. Your own words seemed to drown those out later on in the comment. It was necessary to... clarify.

      --
      *Condense fact from the vapor of nuance*
    20. Re:Tradeoffs? by Anonymous Coward · · Score: 0

      Atomic operations will be non-preemtped.

    21. Re:Tradeoffs? by Anonymous Coward · · Score: 0

      dear putz,

      you can only get interrupted by higher priority events.

    22. Re:Tradeoffs? by King+of+the+World · · Score: 0

      Make it as a link or Slashcode can't tell the difference between you and a malicious page-widener.

    23. Re:Tradeoffs? by sasami · · Score: 3, Informative

      You're confusing preemption with mutual exclusion. Being preemptible only means you can be suspended. It does not mean the task that someone gets to break your locks.

      If a low-priority task locks a resource, it can still be preempted by a high-priority task... but if the high-priority task also wants that resource, it's going to have to get in line just like everyone else. This is also what leads to the possibility of priority inversion.

      Nothing changes if you substitute "kernel task" for "task" in the preceding paragraph.

      --
      I like canned peaches.

      --
      Freedom is not the license to do what we like, it is the power to do what we ought.
    24. Re:Tradeoffs? by RelliK · · Score: 3, Troll
      Aside from the technicalities of this particular patch, your assumption that you're going to lose something when you apply a beneficial patch because 'you don't get anything for free' is, despite appearing mature and clueful, way off mark.

      False. There *is* a tradeoff. And you probably want to take an Operating Systems course before spewing "there is no tradeoff with Free Software" nonsense. (BTW, I wanted to ask the same question).

      Anyway, here is how it works: a ready, higher-priority process can kick off a running, lower priority process before the running process's time slice expires. This does indeed improve responsiveness so that your machine "feels" (*)faster, but in reality it actually runs slower. The cost of pre-emptible kernel is that it does more process switching than a non-preemptible one (see above, it can (and does) interrupt a process before its time slice is finished). More process switching requires more CPU time, concequently, less CPU time is spent on actually doing work. So yes, the good thing is that it decreases latency (hence better responsiveness). But the bad thing is that it decreases throughput (the amount of work actually done) because of the increased process switching overhead.

      (*) The reason your machine "feels" faster is that the GUI becomes more responsive. But that is pure illusion! Your machine actually does less work. Thus, the pre-emptible kernel patch would probably be useful for workstations, but you definitely don't want to use it on a server.

      So the question becomes: what is the throughput/latency tradeoff with the current implementation of the preemptible kernel?

      --
      ___
      If you think big enough, you'll never have to do it.
    25. Re:Tradeoffs? by Anonymous Coward · · Score: 0

      You are an ass.

    26. Re:Tradeoffs? by psamuels · · Score: 5, Insightful
      You don't get anything for free.

      Not quite true - some Linux patches give unilateral improvement. But I do see your point.

      What is the tradeoff that occurs when you integrate this patch?

      None of the other responses to this thread (that I've noticed) addressed one tradeoff: complexity and bugs. Ever since Linux started to support SMP systems, SMP kernels have been somewhat buggier than UP kernels. This is because there are a lot of potential mistakes to be made - getting and releasing spinlocks and semaphores at the right places is not trivial stuff. Of course bugs have been fixed over the past several years, and SMP is now considered a standard Linux feature (in 2.0 it was "experimental"), but there are still no doubt lots of SMP bugs in some of the more obscure device drivers.

      The problem with the preempt patch is that it introduces all these potential bugs into a standard non-SMP kernel, since preempt uses much the same basic mechanism as SMP. Most people only have one CPU, but now these people will be exposed to the same "increased level of risk" as SMP systems.

      In a way, that could be considered a benefit - this may serve to flush out some of those last remaining SMP bugs. The SMP code paths will be exercised by a lot of people now.

      --
      "How can you claim that you are anti-crack, while still writing a window manager?" — Metacity README
    27. Re:Tradeoffs? by chuckw · · Score: 1, Troll

      Oh come on sydb you coward give me a kiss :-)

      --
      *Condense fact from the vapor of nuance*
    28. Re:Tradeoffs? by Ondo · · Score: 1

      False. There *is* a tradeoff.

      You seem to have missed the "Aside from the technicalities of this particular patch" line. Yes, this patch has a tradeoff. No, not every possible patch that improves stuff will have tradeoffs.

    29. Re:Tradeoffs? by Wumpus · · Score: 1

      I think it's "free as those free peanuts you get on transatlantic flights in shiny little plastic bags".

      You can't stand 'em, but they're free, so you eat 'em anyway.

    30. Re:Tradeoffs? by Anonymous Coward · · Score: 0
      (*) The reason your machine "feels" faster is that the GUI becomes more responsive. But that is pure illusion! Your machine actually does less work.


      How is this relevant to the average user? If it "feels" faster, it IS faster. This ain't no batch mode VAX we're talking about here.
    31. Re:Tradeoffs? by BlowCat · · Score: 3, Insightful
      In fact, you just demonstrated that the processor does more work with the preemptible kernel. Perhaps you were assuming that all 100% of CPU time is utilized and that faster GUI is not really useful, so the processor does less "useful work".

      This is not true in case of workstations, whose primary purpose is to provide smooth and fast environment for people to work, not to crunch numbers.

      Neither does your assumption hold for embedded systems - their function is often to provide fast responce to external signals, which they can do much better now. Most embedded systems don't utilize 100% of the processor power either.

      It is only in the case of servers with heavy I/O that your reasoning makes sence. But the solution is in the hardware - use bigger blocks of data, and the processor won't be interrupted too much.

    32. Re:Tradeoffs? by Ami+Ganguli · · Score: 5, Informative
      If you're running a big-ass server, it's probably head-less, anyways - and you won't have any large, interactive processes preempting the kernel for smoothness.

      But you will have IO-bound processes coming alive faster once their data is available, often improving throughput. There have been benchmarks floating around that indicate that a lot of typical server workloads benefit from this patch too.

      It appears that this is generally a good thing. The only downside is the added complexity.

      --
      It is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail. - Abraham Maslow
    33. Re:Tradeoffs? by crsm · · Score: 1

      a ready, higher-priority process can kick off a running, lower priority process before the running process's time slice expires

      This is not entirely correct. The kernel always had the possibility of interupting userland processes even if they didn't use up all of their timeslice.

      What the preemption patch adds to this scheme is that a kernel process can now be interrupted by a userland process. This is done at the existing SMP scheduling points already in the kernel code - and thats IMO a very elegant approach of this patch.

    34. Re:Tradeoffs? by Anonymous Coward · · Score: 0

      More context switching == more time spent switching == less time spent working
      The patch does reduce throughput by, reportedly, 5% or so. The patch gave you a 'make config' option to turn it on or off, and I assume the merged version does, as well. For latency-insensitive servers, like web and mail, leave it off.

    35. Re:Tradeoffs? by sydb · · Score: 1

      That wasn't me, I don't resort to name calling in my posts.

      He was right though :-) You didn't read what I said.

      --
      Yours Sincerely, Michael.
    36. Re:Tradeoffs? by RelliK · · Score: 2
      Bullshit. As I already explained, this patch causes the kernel to switch processes more often. More process switching means more CPU overhead. So, more CPU time is spent on switching and less on doing work. What part of that did you not undestand? So lower latency comes at a price of decreased throughput. You cannot do more process switching without paying the price in throughput. Period. I do suggest you take that OS course.

      Perhaps you were assuming that all 100% of CPU time is utilized and that faster GUI is not really useful, so the processor does less "useful work".

      If CPU is not being used than you wouldn't need this patch to schedule a GUI process. Pre-emptible patch makes a difference only when there is a lower priority process competing with the GUI processes.

      --
      ___
      If you think big enough, you'll never have to do it.
    37. Re:Tradeoffs? by pronik · · Score: 1

      If you're running a workstation, this means that X won't bog down as much when you're running those huge simulations, compiles, etc. You mean I won't need to wait while my diskette is being formatted neither? Wow, at last.... Whoops, wrong OS.

    38. Re:Tradeoffs? by Hast · · Score: 2, Insightful

      I seem to recall that one of the bigger issues was that Linus wanted the problems to be fixd, not the symptoms.

      That is, the correct way to fix this was not to make the kernel pre-empt., it was to make the slow parts in the kernel faster.

      Seems like he changed his mind on that account though. (Or perhaps he just figures that this is a good way to "fix it for later". I would assume that they [core kernel hackers] have enough to do in any case.

      And naturally the patch can (and has) introduce new bugs into the kernel which are complicated to debug. (Since when the kernel/driver were written it was assumed that it would be non pre-empt.)

    39. Re:Tradeoffs? by Hast · · Score: 1
      The reason your machine "feels" faster is that the GUI becomes more responsive. But that is pure illusion!


      Well, you do decrease the actual latency of the system. That is the entire point of the patch. It is true that you also decrease the throughput of the system, so it will take longer to get the same work done. (Just as you stated.)

      So when you click a button it actually /does/ respond faster, there is no illusion about that. As long as you are not already having throughput problems then this patch shouldn't completely wreck your system. (Well it might, but due to other parts of the system not wanting to be pre-emptible.)
    40. Re:Tradeoffs? by Hast · · Score: 1
      Someone else already mentioned that this is regarding mutual exclusion and not really pre-emption; but there is a neat tie in.

      Or is there a way to prevent that from being preemptable?

      Yes, you use spin-locks. These are basically semaphores but they work in an SMP context as well. These were already in the kernel, to make SMP work. They can also be used for pre-emption, because the basic problem is quite similar. So with this patch you are essentially running an SMP kernel, with a modified scheduler.

      Very clever trick.
    41. Re:Tradeoffs? by davidmb · · Score: 0

      You're talking rubbish. Very few systems use 100% of CPU time. Latency is completely different to CPU overhead, it's based on the amount of time spent in the kernel. Get your facts straight.

  9. Scalability of a pre-emptible kernal? by Maddog_Delphi97 · · Score: 4, Interesting

    What effect would a pre-emptible kernal have on the scalability of Linux?

    As far as I can tell, a particularly responsive kernal wouldn't scale very well, since there wouldn't any guarantees as how much "time" as being spent on a thread/process by the CPU.

    Think of a large, multi-user environment based on Linux. Do you really want any user to pre-empt the processing in the kernal by CPU to the detriment of other users? A more logical answer to this is to have set guarantees as how much processing time is given to each user. It shouldn't matter if it's one user or 2,000 users, the speed of applications for each user should stay the same as much as possible.

    Maybe I'm describing Solaris, or some other operating system like this.

    1. Re:Scalability of a pre-emptible kernal? by restive · · Score: 4, Insightful

      If you don't like it, treat it the same way as SMP...turn it off!

      The fact that this is built into the kernel means that we don't always have to go out and download patches to change this. I would assume that vendors using the Linux kernel would make decisions on how to compile the kernel to suit their environment.

      There are lots of people that are frustrated by the current need to go and get patches to change this. Incorporating it into the main kernel should be very positive, IMHO.

    2. Re:Scalability of a pre-emptible kernal? by be-fan · · Score: 3, Informative

      It shouldn't have ANY effect on scalability. First, scalability really refers to how well the kernel handles multiple processors*, which isn't what you're talking about. Second, a process doesn't preempt another process unless it has a lower priority. As long as each of the 2000 users' apps have the same priority level, they'll all get the same response times. The only time preemptibility comes into effect is when the priorities are diffrent. In that case, a higher priority process can preempt a lower priority one, even if the lower priority process is running in the kernel, just like it should be. Big name UNIXs like Solaris are fully preemptible, and there is little question about how well they scale to thousands of users.

      *Not technically, but that's the most common usage.

      --
      A deep unwavering belief is a sure sign you're missing something...
    3. Re:Scalability of a pre-emptible kernal? by Fjord · · Score: 5, Insightful

      "Do you really want any user to pre-empt the processing in the kernal by CPU to the detriment of other users? A more logical answer to this is to have set guarantees as how much processing time is given to each user."

      Actually, I would think it would be the opposite. Being able to preempt within the kernel can pretect you against a DOS attack where a process repeatedly makes long running kernel calls. That would give that process more than it's fair share of time, and other processes couldn't respond to interrupts as well. Without a fully preemptable kernel, you can't guarantee how long a process can run, because it is impossible to preempt them while they are in a kernel call.

      --
      -no broken link
    4. Re:Scalability of a pre-emptible kernal? by Maddog_Delphi97 · · Score: 1

      Thanks for clearing that up.

      As long as you don't change the priorities, it will work as I described.

      That's something that you would have to keep in consideration when you have thousands of users (or processors) running on the same system.

    5. Re:Scalability of a pre-emptible kernal? by iabervon · · Score: 5, Insightful

      Consider, however, the case where the reason a task is preempted in the kernel is that it has used all of its timeslice. Without the preemptable kernel patch, the task cannot be interrupted to schedule another task. In order to make guarantees about how much time will be given to each process, it needs to be possible to stop a process when its time is up essentially no matter what the process is doing.

      The issues you raise are a matter of scheduling policy, not of whether the kernel is preemptible. Furthermore, for most interactive tasks, the correct behavior is to react quickly, because those tasks haven't used up their timeslices, since they blocked waiting for input. In this case, interactive processes give up the CPU to wait for input, and then get their time back as soon as they have a use for it.

      Of course, this all also applies to tasks which "interact" with the network or the hard drives, which is any task when you have swap space. Processes which are waiting on input want to run as soon as their input is ready, and don't care about time before that. Processes which are not waiting on input want to run as much as possible, and don't care exactly when. Having the scheduler's instructions followed as closely as possible benefits both kinds.

    6. Re:Scalability of a pre-emptible kernal? by psamuels · · Score: 1
      Second, a process doesn't preempt another process unless it has a lower priority. As long as each of the 2000 users' apps have the same priority level, they'll all get the same response times.

      I just thought it was worth pointing out here that Linux already preempts user processes so other processes can run! It has done this since 1991 - that's what "preemptive multitasking" means, and all modern OSes support it. The only distinction with the preempt patch is a rather academic (to most) question of "being in kernel mode" when the preemption happens.

      So, as you say, this is completely orthogonal to scalability.

      --
      "How can you claim that you are anti-crack, while still writing a window manager?" — Metacity README
    7. Re:Scalability of a pre-emptible kernal? by Anonymous Coward · · Score: 0

      Anybody who writes "kernal" or "standart" cannot be taken seriously.

      Oops, just wrote it.

  10. Doesn't everyone else already do this? by jmcnamera · · Score: 1

    I thought other UNIX's and Windows and OSX already did this.

    In fact, I'm surprised that Linux doesn't do it.

    This isn't meant to be flame-bait, I'm a newbie in regards to the kernel. But isn't this common technology everywhere else?

    --
    this is not a sig
    1. Re:Doesn't everyone else already do this? by Max+Threshold · · Score: 5, Informative

      Linux user-space processes have always been preemptible. The kernel itself was not. WinNT/2K is fully preemptible (kernel and user); other flavors of Windows are not. Preemptive multi-tasking means that a process can be forced to give up its control of the CPU. This is opposed to cooperative multi-tasking, which means each process must voluntarily give up control before others can proceed. In general, preemptive multi-tasking is a good thing because it means one process cannot hog the CPU.

    2. Re:Doesn't everyone else already do this? by sinserve · · Score: 1

      The so called "other" OSes, are purely *desktop*
      OSes, and require responsive GUIs.
      Linux runs on more hardware than Mac, Windows and
      all commercial Unices combined, and what is a "must have"
      for one linux user is a "nono" for another.

    3. Re:Doesn't everyone else already do this? by sydb · · Score: 2

      Perhaps you're thinking of 'pre-emptive multitasking'? Here's some general multi-tasking info.

      As I understand it, the pre-emptible kernel patch allows user processes to pre-empt the kernel itself. Apparently the NT I/O subsystem is pre-emptible.

      --
      Yours Sincerely, Michael.
    4. Re:Doesn't everyone else already do this? by Anonymous Coward · · Score: 0
      Linux runs on more hardware than Mac, Windows and all commercial Unices combined,
      No. Linux could be run on more hardware than blah blah blah, but IRL it's rare to find it running on anything. Especially if you read that as "anything worthwhile".
    5. Re:Doesn't everyone else already do this? by Fjord · · Score: 5, Informative

      You are probably thinking of preemtive multitasking. Most modern operating systems use preemtive multitasking, where the kernel enforces when a process gets on the CPU, instead of cooperative multitasking, where a process (in a cooperative way) tells the kernel that it's okay to interrupt it (directly or indirectly) and then kernel makes a decision to give another process the CPU. Cooperative multitasking is bad because a process can decide not to cooperate and effectively take over the system.

      This is a refinement on preemptive multitasking, which linux had before. Before having a preemptive kernel, the kernel could only preempt the process if it wasn't in a kernel call (okay, there are some kernel calls like writes to disk that it can preempt but most it can't). So, if an interrupt happens while my process is in the middle of a kernel call, the process that handles the interrupt will just have to wait until the call is completed.

      With this patch, my process will be preempted for the handling process, allowing it to respond in a very timely fashion. Thus, this is considered to be a prerequisite for real time operating systems.

      According to this Windows NT does have a preemptive kernel, but I doubt 9x/ME do. I'm not even sure that page is right, since I couldn't find any primary sources for this and other pages imply it doesn't (by listing a fully preemptive kernel as a feature under one operative system, but not listing it under windows NT).

      Windows CE definitly has a fully preemptive kernel.

      --
      -no broken link
    6. Re:Doesn't everyone else already do this? by Cid+Highwind · · Score: 3, Informative

      There are different level of multitaksing.
      Cooperative multitasking - each process has to willingly give up the CPU, thus one program can bog down the whole machine. Older MacOS incarnations are like this

      Preemptive multitasking - the kernel and high-priority user tasks can preempt userspace tasks, and force them to give up control of the CPU. Linux < 2.5.3 is like this (I believe Win9x and MacOSX are too)

      Preemptable kernel - High priority user tasks can preempt the kernel as well as each other. Net result - lower latency I/O, possible reduced throughput due to more CPU overhead. QNX, some other commercial Unices, and WinNT/2k are here

      --
      0 1 - just my two bits
    7. Re:Doesn't everyone else already do this? by arkanes · · Score: 2

      Well, even if the NT kernel is preemtible, the implementation sucks. Overloading or crashing drivers can and will lock up every other process on the machine, while with 2k a hung kernel process doesn't kill the entire machine. Of course, it may just be a better-behaved shell, I haven't done any real testing, just my observations.

    8. Re:Doesn't everyone else already do this? by julianmayer · · Score: 2

      Preemptive multitasking - the kernel and high-priority user tasks can preempt userspace tasks, and force them to give up control of the CPU. Linux and MacOSX are too)

      FYI, MacOSX also has a preemtible kernel (Mach 3.0)

    9. Re:Doesn't everyone else already do this? by Anonymous Coward · · Score: 0

      crashing drivers can and will lock up

      Crashing drivers crash the system. BSOD!

      hung kernel process

      NT & 2K don't have kernel processes.

    10. Re:Doesn't everyone else already do this? by Locutus · · Score: 2

      In 1991, OS/2 2.0 had pre-emptive multi-tasking AND multi-threading in the kernel. Windows NT 3.1 had it too but what a slow pig that was.

      I don't think *nix's got multi-threading til the mid 90's (Solaris first?). But then again, creating process's on *nix's was faster than creating a thread on Windows. On OS/2 that was questionable ( IBM knows how to make a kernel ).

      This is a very good move and putting it into the 2.5.x kernel so early will help test the heck out of it. Good move. IMHO

      LoB

      --
      "Anyone who stands out in the middle of a road looks like roadkill to me." --Linus
    11. Re:Doesn't everyone else already do this? by Anonymous Coward · · Score: 0

      OS X should have less in the kernel than most other *nixes because it's based on the Mach microkernel instead of a monolithic kernel (like Linux), but I don't think the kernel itself is preemptible.

  11. Great Feature by Compass · · Score: 0, Redundant

    The preemptive kernel if it is as good as it seems can only bring benefits to the linux community.

    1. Re:Great Feature by sydb · · Score: 3

      Not pre-emptive, pre-emptible. The first describes a mode of multi-tasking. The second refers to user processes being able to pre-empt the kernel.

      --
      Yours Sincerely, Michael.
  12. won't help X too much by mrm677 · · Score: 2, Interesting

    I know this is somewhat offtopic, however to make Linux more responsive, we need to improve X somehow. I am not saying that X sucks...I think it is a fantastic system

    Anybody who uses X and Windows regularly knows the difference in responsiveness. X Windows does what it was for designed extremely well-- a client/server display system. However, due to the marshalling and de-marshalling of X calls, even if completely local, it will always be less responsive than other methods (winblows).

    But I have an idea. Develop a system that implements the exact same interface as X but does no marshalling/demarshalling. Pixels can be written directly to the framebuffer. So you are thinking, "Yeah, but I want to use X apps without recompiling". Ok, use library interposition. This also allows you to use a "local" and "global" X library to maintain client/server capabilities. For those who aren't familar which library interpositioning, it essentially takes advantage of dynamic linking (set LD_LIBRARY_PATH on Unix). If you want to run a X program that directly writes to the framebuffer, then switch your LD_LIBRARY_PATH to a different directory before the program is executed. This could get annoying, but a Window Manager like Gnome could take care of this automatically.

    Granted that our existing X server would have to be retrofitted to allow 2 different types of X libraries to update the same display to that we can run standard client/server X apps with the new "directXfree86" (no pun intended) apps.

    However library interpositioning can be used to make X programs more responsive without sacrificing client/server capabilities and compatibility with existing applications (except those statically linked of course).

    1. Re:won't help X too much by Anonymous Coward · · Score: 0

      Adobe released Framemaker as a Linux beta awhile back, but it has since expired. I read one USENET post that a guy uses LD_PRELOAD to override the gettimeofday() system call, so he can use Framemaker indefinitely!! You can do this stuff to change an application's behavior without changing the application at all.

    2. Re:won't help X too much by nathanh · · Score: 3, Informative
      But I have an idea. Develop a system that implements the exact same interface as X but does no marshalling/demarshalling.

      Impossible. The X11 protocol is incompatible with this idea.

      Pixels can be written directly to the framebuffer. So you are thinking, "Yeah, but I want to use X apps without recompiling". Ok, use library interposition. This also allows you to use a "local" and "global" X library to maintain client/server capabilities. For those who aren't familar which library interpositioning, it essentially takes advantage of dynamic linking (set LD_LIBRARY_PATH on Unix). If you want to run a X program that directly writes to the framebuffer, then switch your LD_LIBRARY_PATH to a different directory before the program is executed. This could get annoying, but a Window Manager like Gnome could take care of this automatically.

      This has been tried. See the D11 paper by Kilgard.

      http://citeseer.nj.nec.com/125132.html

      The idea is called Direct Rendering and it is not a significant performance win for most graphics ops. The obvious exception is high bandwidth graphics such as OpenGL and streaming video. You'll notice that XFree86 already has direct rendering for OpenGL and streaming video.

      Summary: X11 is not the bottleneck on your desktop.

    3. Re:won't help X too much by captaineo · · Score: 2

      I've looked at this extensively with kernel tracing tools - the X wire protocol is not the bottleneck. The problems are:

      1) X server event loop should be driven by the monitor retrace, not by mouse/keyboard events

      2) Resizing windows should be synchronous, not asynchronous (this causes the "lag" effect when resizing a window on X)

      3) Toolkits should be double-buffering everything, using client-side layout code (rather than X window objects), and holding all drawing until input events have been handled.

      4) (controversial) - get rid of the window manager; incorporate it into the X server.

    4. Re:won't help X too much by captaineo · · Score: 2

      Just for completeness, I should add that I belive most of X's problems stem from limitations in the hardware it was originally intended to run on (i.e. achingly slow framebuffers on a slow network).

      e.g. window resize events are handled asynchronously because back when X was being designed, it was unthinkable for the client and graphics hardware to be able to respond interactively. But today's hardware can handle this with ease - and that's why window resizing feels so much better on MS Windows - because GDI was designed with assumptions that fit modern machines (i.e. fast video hardware, and no network, so synchronous resizing is not a problem).

      It's sort of a self-fulfilling prophecy - X thinks of itself as a slow graphics system implemented over a high-latency network, and so that's what it becomes, even though the hardware is capable of so much more...

    5. Re:won't help X too much by Error27 · · Score: 1
      >>4) (controversial) - get rid of the window manager; incorporate it into the X server.

      I am interested interested in X. Why do you think that this will speed things up?

      (I don't think it's going to happen any time soon even if you are right, but I'm curious anyways)

    6. Re:won't help X too much by captaineo · · Score: 2

      A couple of reasons-

      1) although network traffic and context switches are not the main problem with X, cutting the window manager out of the loop would probably almost double the speed of handling window move/resize events. (do you *really* want to wake up the WM on every mouse interrupt, when X is perfectly capable of moving windows itself?)

      2) it is *hard* to write a good WM. There are lots of little details in event handling/ordering, client communication, etc, that are easy to get wrong or omit. One common codebase, approved by the X developers, could reduce the proliferation of semi-correct WMs.

      3) are WMs *really* that different? I've used many of them over the past couple years (sawmill/sawfish, icewm, kwin, enlightenment 16, 4Dwm, the GNUstep one...). Honestly the only reason I've switched WMs is because I saw a neat theme that wasn't available for the one I was using =). Aside from that, I've set them all up to operate almost the same way... So I don't really see the benefit in having 10-20 mediocre WMs rather than 1-2 really good ones... Minor customizations like theming and different window behaviors should be added through small DLL plugins rather than writing a whole new WM...

    7. Re:won't help X too much by leuk_he · · Score: 2

      But I have an idea. Develop a system that implements the exact same interface as X but does no marshalling/demarshalling. Pixels can be written directly to the framebuffer.

      The details should be implemented somewhat different, and i think in the end you will end up like windows NT3.5 vs 4.0,

      In windows 4.0 the GDI was tied more to the kernel then before: more speed (no context switch for draing at the screen). Disadvantage: Bugs in implementation allow to bring down the screen=system. Hey they did not do it right the first time (highcolor bugs)

    8. Re:won't help X too much by Zygo · · Score: 1

      3) Toolkits should be double-buffering everything, using client-side layout code (rather than X window objects), and holding all drawing until input events have been handled.

      A lot of X toolkits are very dumb; they are little more than event loops wrapped around libX11 and maybe libXt. Many of the less-heavily-optimized toolkits don't bother collapsing events, or they make it difficult for applications to use such optimizations. Some toolkits leave redraw of non-widget objects entirely to the application, and most application authors are not going to bother writing proper minimal-refresh code, especially if the objects are simple enough that the delay for a full redraw on every expose event is tolerable.

      In the worst cases (i.e. most of them, it seems), applications redraw _everything_ if _any_ part of their visible area is exposed, and the only optimization done is window clipping by the X server.

      This is actually a problem in Windoze too, if an application is written the same way. Big/complex Windoze apps assign teams of people to fix their refresh bottlenecks, or they render everything double-buffered and do screen updates by bitblitting, or (ugh) they have a high-priority thread that just does screen updates while the low-priority threads do all the actual work, so the application _looks_ fast, when in fact it is slow.

      Take a look at the implementation of Gtk or Tk canvas objects to see what hoops you have to jump through to get smooth updates of complex graphic objects. Also take a look at how fast you can resize windows owned by these objects. Then look at applications designed for lesser toolkits and see all the duplication of effort this leads to.

      --
      -- I avoid spam by accepting only OpenPGP encrypted or signed email at this address. Clear-signed, RFC2015, heck, even
  13. If I had mod points by sinserve · · Score: 0, Offtopic

    I would mod you down :'D

    The kernel is GPLed, so anything that makes into
    it is free as in speech.

    1. Re:If I had mod points by Anonymous Coward · · Score: 0

      bwee bwee bwee

      No bitch, *I* had mod points. HAHAHAHAHA

  14. This and O(1) scheduling by Ingo Molnar _rock_ by sydb · · Score: 5, Informative

    Quake 3 has never been smoother on my machine. 2.4.18-pre7 with Robert Love's Pre-emptible Kernel patch and Ingo's O(1) patch. Get it.

    --
    Yours Sincerely, Michael.
    1. Re:This and O(1) scheduling by Ingo Molnar _rock_ by Anonymous Coward · · Score: 0

      Why are you running many copies of quake at the same time?

      If you are only running a few active (ps shows "R" as the state) tasks then the O(1) scheduler shouldn't make much of a difference either way in performance. Are you sure it's not your imagination or that it isn't another patch which gave you the performace boost?

    2. Re:This and O(1) scheduling by Ingo Molnar _rock_ by PlaysWithMatches · · Score: 2, Informative

      I'm not sure of the primary source for the O(1) patch, but Red Hat has a download site for it. It would be helpful if when people recommend patches and such, they would provide a link. ;)

      --

      Mozilla's a nice operating system, but it needs a better browser.
    3. Re:This and O(1) scheduling by Ingo Molnar _rock_ by Kernel+Panic · · Score: 1

      How did you get that to work? Whenever I try to patch those both with any kernel, I get rejects on whichever is done second.

      --
      No datacenter is secure if it has windows.
    4. Re:This and O(1) scheduling by Ingo Molnar _rock_ by Lac · · Score: 3, Funny

      Quake 3 has never been smoother on my machine. 2.4.18-pre7 with Robert Love's Pre-emptible Kernel patch and Ingo's O(1) patch.

      Sounds awesome. Quick question: does Ingo's patch make all of userland O(1), or just the kernel? I'm curious.

      (1/5 wink)

    5. Re:This and O(1) scheduling by Ingo Molnar _rock_ by doug363 · · Score: 4, Informative

      The fact that the scheduler is O(1) is largely irrelevant, although that's how it was announced on the Kernel mailing list so that's what it's called. The patch includes rewrites for other critical scheduler functions which improve performance under common conditions, especially interactive performance. In particular, it gives priority boosts for processes that have low average load requirements when they need the CPU.

    6. Re:This and O(1) scheduling by Ingo Molnar _rock_ by sydb · · Score: 2

      Look here for a pre-emptible kernel patch which works with ingo's O(1). Read it's name, act appropriately.

      --
      Yours Sincerely, Michael.
    7. Re:This and O(1) scheduling by Ingo Molnar _rock_ by sydb · · Score: 1

      No, it's not my imagination. I was running 2.4.16 with pre-emptible kernel, then switched to 2.4.18-pre7 with pre-emptible kernel AND O(1) scheduling.

      Quake3 performance improved _dramatically_.

      However, as doug363 points out below, it probably isn't the O(1) nature of the O(1) scheduling algorithm which made the difference. But hey, my box has several active processes, so who knows. I've not been keen enough to do that level of testing.

      --
      Yours Sincerely, Michael.
  15. Here is the bitkeeper log by Khalid · · Score: 3, Informative

    http://linux.bkbits.net:8088/linux-2.5/ChangeSet@- 1d?nav=index.html

    It's just 3 hours old :)

    A very nice way to follow the fresher kernel !

    1. Re:Here is the bitkeeper log by Anonymous Coward · · Score: 0

      Any one else notice that Linus has approved two times as many patches since he started using source code control system?

    2. Re:Here is the bitkeeper log by Anonymous Coward · · Score: 0

      How many more bugs will he fix if he ever starts using a debugger???

    3. Re:Here is the bitkeeper log by Anonymous Coward · · Score: 0

      And how many more if he pays for some professional developers to help him with the tricky bits he doesn't understand?

    4. Re:Here is the bitkeeper log by NDPTAL85 · · Score: 0

      The guy has a CS degree. How much more "professional" as a programmer can you get?

      --
      Mac OS X and Windows XP working side by side to fight back the night.
    5. Re:Here is the bitkeeper log by Anonymous Coward · · Score: 0

      I'm kinda looking for him to have experience on a project a lot less shitty than Linux.

    6. Re:Here is the bitkeeper log by NDPTAL85 · · Score: 0

      You call something that's put the fear in Microsoft, and rallied the combined forces of IBM, HP, Dell and Sun "shitty"? Hmmmmmm.

      --
      Mac OS X and Windows XP working side by side to fight back the night.
  16. didnt work for me with 2.4.17 by supaphinn · · Score: 2, Interesting

    I compiled this into 2.4.17 with the preempt-kernel-rml-2.4.17-1 patch. When i booted i got PPP module errors, and when i tried to install the NVIDIA (2314/2313) drivers it gave me more errors. So i went back and disabled it...

    Im looking foward to trying this patch out again when 2.4.18 comes out and i hope it works better.

    -phinn

  17. really by Anonymous Coward · · Score: 0

    Not that I'm doubting you or anything, but this doesn't seem like the kind of thing that one would hear about. It's really more an implementation detail, something most users wouldn't notice unless told about.

  18. Other arches? by saintlupus · · Score: 4, Interesting

    Has anyone tried this patch on non-x86 hardware?

    I've got a Powermac 7200 I'm playing with YDL on right now...

    (Note: I am not a programmer. Should this be something patently obvious to anyone with the most casual knowledge of OS programming, I still don't know. So don't flame me.)

    --saint

    1. Re:Other arches? by Anonymous Coward · · Score: 1, Funny

      Works great on my VIC 20.

    2. Re:Other arches? by referee · · Score: 1

      This patch is for IA32/x86 only.

    3. Re:Other arches? by Anonymous Coward · · Score: 0
      Operates better on my dick 14, inches long ramming down your silken boy throat.

      Trolling for Jesus

    4. Re:Other arches? by Anonymous Coward · · Score: 0

      I'm not quite sure on this one either, to be quite honest, but I think it's safe to assume that the patch is not x86-only.

      From what I know, x86 isn't that big a player in the embedded market. To hot, too power-hungry, whatever. So, if this patch's benefits are aimed (at part) at that market, it wouldn't make sense to support only the x86 architecture.

      Furthermore, I don't see how this patch would be architecture-specific. It seems to change the way the kernel does things internally, rather than the way the kernel talks to any particular class of hardware.

      And that's all I've got to say about that.

      - John

    5. Re:Other arches? by ender81b · · Score: 1

      Not a programmer either so if I get this wrong sorry however I think:

      No it is architecture independent. There is nothing in this patch that address hardware - it simply allows the kernel to halt processs to free up resources for other more pressing functions, a kernel function; not a hardware function.

    6. Re:Other arches? by hysterion · · Score: 5, Informative

      I wondered too (I also have a 7200), and found this answer in the changelog:

      <rml@tech9.net>:
      [PATCH] Re: [PATCH] Preemptible Kernel for 2.5

      On Sat, 2002-02-09...<snip>

      Again, this is a minimal i386-only patch. I have other arches, documentation, etc. Patch against 2.5.4-pre5. Enjoy,

      Robert Love

    7. Re:Other arches? by Fnord · · Score: 2

      The kernel already halts processes to free up resources for more pressing functions. Thats kind of the defenition of multitasking. What this allows is for the kernel to halt itself if something in userspace is more deserving of processor time.

    8. Re:Other arches? by Anonymous Coward · · Score: 1, Informative

      Well, since none of us seemed to have even remotely complete answers, I decided to do a bit of research. Actually it doesn't really deserve the term 'research' as all I did was take a glance at the appropriate README in RML's directory on kernel.org.

      The patch supports x86, ARM, and SH. Comments the author (Robert Love) has made lead me to believe that the same techniques will work with more architectures. And, now that the patch is mainline, it probably won't be long before this is the case.

      If nothing else, all us PPC-heads (or fans of other architectures...) have something to look forward to for a few weeks, eh? ;-)

      Take it easy,

      - John

    9. Re:Other arches? by referee · · Score: 1

      Wrong!

      From the ChangleLog

      Supported arches on 2.4: ARM, i386, and SH
      Supported arches on 2.5: i386 and SPARC64

  19. And what about 2.4? by rseuhs · · Score: 3, Insightful
    I thought that the preempt patch was quite a way from being part of the linus tree.

    I know that I shouldn't ask this because there has already been enough changes and troubles in 2.4 - but I've got some Karma to burn:

    Wasn't this patch long enough available on 2.4 so that it should be stable enough?

    1. Re:And what about 2.4? by evil_one · · Score: 4, Informative

      On one hand, the preempt patch makes heavy use of SMP spinlocks, and the stability of preempt in parts of the kernel that arn't SMP capable (which are few and far between at this point) and on SMP systems is questionable.
      On the other hand, an awful lot of users have been testing and reporting back to lkml, and Robert Love has been persuing the bugs with the dedication of a first love. I'm sure that scores points with the power(s) that be on LK.

      --
      Desperation is a stinky cologne
    2. Re:And what about 2.4? by Anonymous Coward · · Score: 0

      I've been running a preempt-patched 2.4.17 kernel on a dual Pentium Pro 180 system for several weeks now
      and it has been totally stable. YMMV, of course.

  20. Agree, here is the excerpt from the config file by Khalid · · Score: 3, Informative

    Taken from the Bitkeeper diff

    --- 1.3/arch/i386/Config.help Tue Jan 29 06:32:09 2002
    +++ 1.4/arch/i386/Config.help Sat Feb 9 11:11:32 2002
    @@ -25,6 +25,16 @@

    If you don't know what to do here, say N.

    +CONFIG_PREEMPT
    + This option reduces the latency of the kernel when reacting to
    + real-time or interactive events by allowing a low priority process to
    + be preempted even if it is in kernel mode executing a system call.
    + This allows applications to run more reliably even when the system is
    + under load.
    +
    + Say Y here if you are building a kernel for a desktop, embedded
    + or real-time system. Say N if you are unsure.
    +
    CONFIG_X86
    This is Linux's home port. Linux was originally native to the Intel
    386, and runs on all the later x86 processors including the Intel

  21. Ingo? by Anonymous Coward · · Score: 0

    What is an O(1) patch?

    1. Re:Ingo? by sydb · · Score: 3, Informative

      The patch makes scheduling occur in O(1) time... i.e. very good scaling as number of processes grow, I believe.

      O(1) is constant time regardless of input size. O(n) means time grows linearly with input size. There's others but I don't know that much about it...

      --
      Yours Sincerely, Michael.
    2. Re:Ingo? by mikera · · Score: 4, Informative

      You can have O(f(n)) where f(n) is pretty much any function of n.

      Classifying algorithms this way is *extremely* useful for working out what will give good real-world performance.

      In general, you want to stick to O(1) or O(log n) to have performance that scales in a reasonably effective way.

      Quite a lot of algorithms are O(n) which is OK for small values of n but can get nasty when n becomes large. Inserting a value into a linked list is a typical O(n) algorithm - OK for small lists, bad for long ones as you have to run down the list to find the correct insertion point. (Tchnically you only have to go halfway down the list on average, which would make it O(0.5n), but by convention and for practicality purposes the notation drops and constant factors).

      A large proportion of processor bottlenecks are due to getting stuck in O(n^2) or O(n.log n) tasks. Sorting algorithms tend to fall into this category, which explains why they are often slow and/or processor hungry.

      Higher polynomial orders such as O(n^4) etc are possible, but generally less common. Sometimes writing a sort algorithm really badly will get you into this territory however :-)

      Then there are the *really evil* algorithms that behave like O(2^n) or O(n!). These rapidly become intractable as n grows. Good examples would be the exhastive search of soloutions for the travelling salesman problem, or an exhaustive search of the tree of moves for a game like chess. When faced with this kind of problem, you are basically forced to either limit yourself to small values of n or choose an "approximate" algorithm, such as accepting the best solution found after a timeout period.

    3. Re:Ingo? by p3d0 · · Score: 3, Informative
      Tchnically you only have to go halfway down the list on average, which would make it O(0.5n), but by convention and for practicality purposes the notation drops and constant factors).
      Actually, that's not a convention. It's the definition of the big-O notation. See here.
      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  22. Can you say "Re-inventing the wheel?" by Mr+Z · · Score: 5, Interesting

    Writing pixels directly to a frame-buffer is slow. You lose all of the acceleration features of your video card. Keeping as much of the protocol at a high level as possible is good. The only things that benefit from direct frame-buffer access are programs that do all their own rendering. (Think video decoders.)

    Still, if you think about it, the basic gist of your idea is to get rid of the network channel from the communication protocol, and instead have the app talk directly to the X server, say, in shared memory. If so, then how does your idea compare to MITSHM and Shared-Memory Transport? Or the Direct Rendering Interface for that matter? And for 2-D stuff, let's not forget the Direct Graphics Architecture extension. Nothing stops GTK, Qt and friends from using any one of these technologies if they'd improve performance and latency.

    --Joe
    1. Re:Can you say "Re-inventing the wheel?" by Junta · · Score: 5, Informative

      Pretty good response, though I would note that even for video decoders writing to a raw framebuffer isn't desired... Writing directly to an allocated overlay in a colorspace natural to the decoding is better (that way, X provides a surface to write to that takes care of both colorspace conversion and scaling in hardware, two *Very* expensive video rendering tasks.). There are very few applications in which direct, unmediated framebuffer access is that beneficial... For example some apps support all sorts of targets from standard Xlib, to XShm, to DGA, to GL. The DGA is probably the closes to direct access, and, no surprise, it isn't that impressive....
      Of course, I think the poster didn't really mean direct framebuffer access, but rather trimming Xlib where possible to not do things that increase latency locally, which, as many have pointed out Xshm does that very thing..

      --
      XML is like violence. If it doesn't solve the problem, use more.
    2. Re:Can you say "Re-inventing the wheel?" by kevinank · · Score: 3, Informative
      The main slowdown for X doesn't come from Marshalling data. The marshallers are quite fast, and run at CPU speed. The latency mostly grows in the interaction between the X server and the display hardware. Since the X server is running in user mode it doesn't have access to Hardware interrupts. As a result the server ends up polling the hardware registers until the operation is complete, which wastes huge amounts of time. Still a lot faster than blitting video memory in the CPU, but not nearly as fast as Windows can manage.

      Not that I'm an expert on Video hardware or anything, but that is paraphrased from an explanation given by X-inside for their X server.

      --
      LibBT: BitTorrent for C - small - fast - clean (Now Versio
    3. Re:Can you say "Re-inventing the wheel?" by Mr+Z · · Score: 1
      Pretty good response, though I would note that even for video decoders writing to a raw framebuffer isn't desired... Writing directly to an allocated overlay in a colorspace natural to the decoding is better (that way, X provides a surface to write to that takes care of both colorspace conversion and scaling in hardware, two *Very* expensive video rendering tasks.).

      I thought of that after I clicked [SUBMIT]. You're right that even video can benefit from hardware acceleration when it's available. And modern cards seem to provide both of the forms you mention -- YCC to RGB conversion, and bitmap stretching.

      In general, it's hard to get great performance from direct FB access. Direct hardware access might have been the mantra of the 320x240-ish "Mode X VGA" era, but it's "so last-Millennium." It just doesn't scale to large resolutions, varied hardware, and tons of apps. Higher-level primitives and display independence are good things, since they're the only hope for decent performance and reasonable continuing compatibility on moderm hardware. Needless communication overheads need to go -- latency is bad! -- but let's not lose the progress in the process.

      --Joe
    4. Re:Can you say "Re-inventing the wheel?" by Mr+Z · · Score: 1

      Does the Direct Rendering Manager support help this issue? APIs such as drmGetInterruptFromBusID seem to be a good sign.

      --Joe
    5. Re:Can you say "Re-inventing the wheel?" by WzDD · · Score: 1

      MIT shared memory is for transferring pixmaps. SMA does the same. These don't remove the actual problem step, which is the marshalling and demarshalling of X messages. NFI about DRI, that could be the way to go for all I know.

  23. if you want to do it, do it by Anonymous Coward · · Score: 0
    If you want to write directly to pixmaps without marshalling/demarshalling or using Xlib calls, then use MIT shared pixmaps.

    Honestly, every suggestion I've heard for "replacing" X involves re-implementating an already existing X extension. You *could* re-implement all of Xlib, or you could just read up on XShm. Guess which is more work.

  24. and it won't by Ranger+Rick · · Score: 3, Informative

    I expect it won't be any better.

    NVIDIA drivers have to be rebuilt when you build a new kernel. As for PPP, you were probably just missing a driver when you configured.

    --

    WWJD? JWRTFM!!!

  25. Now for the entropy pool. by augustz · · Score: 5, Informative

    Robert Love has another patch that I'm hoping to see make it into the kernel. For systems in headless situations with large entropy reqs, this is pretty much make or break.

    http://www.kernel.org/pub/linux/kernel/people/rml/ netdev-random/README-netdev-random

    describes what it is all about

    1. Re:Now for the entropy pool. by Anonymous Coward · · Score: 0

      Since most x86 rackmount servers seem to come with audio in ports these days, there is a userspace daemon that injects entropy into the pool from the noise in the low bits from the ADC.

    2. Re:Now for the entropy pool. by Rufus211 · · Score: 2, Informative
      god I hate it when people talk about something and then don't give any link. Here's the official info:
      Audio Entropyd is a small program that I wrote to read data from a soundcard, hash it and feed the result to the Linux kernel's random number pool. Since this audio contains at least small amounts of noise, this may be a cheap source of entropy. audio-entropyd takes the difference between stereo channels in an attempt to eliminate hum.
      and the link: http://www.mindrot.org/audio-entropyd.html
    3. Re:Now for the entropy pool. by BlowCat · · Score: 2
      god I hate it when people talk about something and then don't give any link

      god I hate when people talk about something in the server room and I cannot decrypt it. Should have used high bits.

  26. Re:SINCE I AM THE INVENTOR OF LINUX, LET ME TELL Y by RMSIsAnIdiot · · Score: 0

    What the hell are you talking about? Linux is the most stable operating system ever, and this patch should hel----

    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    kernel: current->tss.cr3 = 06672000, %cr3 = 06672000
    kernel: *pde = 00000000
    kernel: Oops: 0000
    kernel: CPU: 0
    kernel: EIP: 0010:[__wake_up+33/56]
    kernel: EFLAGS: 00010287
    kernel: eax: c06cff3c ebx: 00000000 ecx: 00000002 edx: 00000000
    kernel: esi: c06cff38 edi: 00000003 ebp: c64c5ef0 esp: c64c5eec
    kernel: ds: 0018 es: 0018 ss: 0018
    kernel: Process mountd (pid: 308, process nr: 39, stackpage=c64c5000)
    kernel: Stack: c06cfed8 c025df38 c01303c5 c06cfed0 c06cfed0 00000000 c025df38 000a404d
    kernel: c7fe0400 c0130488 c7fe0400 000a404d c025df38 000a404d c774d1d0 c06ce000
    kernel: c64c5f88 c0142356 c7fe0400 000a404d fffffff4 c774d1d0 c06ce000 c4900c18
    kernel: Call Trace: [get_new_inode+173/280] [iget+88/96] [ext2_lookup+82/124] [real_lookup+81/128] [lookup_dentry+294/484] [__namei+38/88] [sys_newlstat+13/96]
    kernel: Code: 8b 02 85 c7 74 f1 89 d0 e8 4a f9 ff ff eb e8 8d 65 f4 5b 5e

    --

  27. [PATCH] To fix compile error on UP systems by worldwideweber · · Score: 5, Informative

    Folks:

    It should be noted that this will lead to a compile error if you enable preemption but disable SMP. To make this build, you need to add this patch:

    diff -urN linux-2.5.4-pre6/include/asm-i386/smplock.h linux/include/asm-i386/smplock.h
    --- linux-2.5.4-pre6/include/asm-i386/smplock.h Sun Feb 10 15:35:55 2002
    +++ linux/include/asm-i386/smplock.h Sun Feb 10 18:15:55 2002
    @@ -15,6 +15,7 @@
    #else
    #ifdef CONFIG_PREEMPT
    #define kernel_locked() preempt_get_count()
    +#define global_irq_holder 0
    #else
    #define kernel_locked() 1
    #endif

    --
    w o r l d w i d e w e b e r
    1. Re:[PATCH] To fix compile error on UP systems by Anonymous Coward · · Score: 0


      You really ought to give that to Linus instead of posting it to slashdot.

    2. Re:[PATCH] To fix compile error on UP systems by Anonymous Coward · · Score: 0

      Please do not use this patch! After applying the patch, my computer feels just like a pussy

    3. Re:[PATCH] To fix compile error on UP systems by nusuth · · Score: 1
      It should be noted that this will lead to a compile error if you enable preemption but disable SMP.

      Are you sure that is OK? I was under the impression that preemptible kernel patch requires SMP locking mechanisms, and they in turn require SMP enabled kernel.

      --

      Gentlemen, you can't fight in here, this is the War Room!

  28. Now if only we can get Linus to up HZ to 1000 by Anonymous Coward · · Score: 0

    If you want truly perfect music and video - up the HZ kernel constant to 1000 from the anemic 100. With modern hardware - why is the HZ constant so freaking low on Linux? With HZ set to 100 you can only get select() or poll() to wait in minimum increments of 100/2, or 50 times per second.

    1. Re:Now if only we can get Linus to up HZ to 1000 by Bert64 · · Score: 1

      On the Alpha the HZ is already 1024, and has been as long as i`ve been using it.

      --
      http://spamdecoy.net - free throwaway anonymous email - avoid spam!
    2. Re:Now if only we can get Linus to up HZ to 1000 by dakoda · · Score: 1

      no kidding. what i though would be even nicer would be a way to dynamically udate hz.. during idle hours, or when one big process is running, hz low would slightly (negligibly probably) increase thru-put, while in busy times, hz==1024 would help responsiveness/reduce latency.

      implimenting this is difficult though (in the middle of it, little to show for it). everything has the right to change the pit (x86, maybe mips) and there seems to be no way to read what was written. pit shold have been made a device from the start.

    3. Re:Now if only we can get Linus to up HZ to 1000 by Anonymous Coward · · Score: 0

      It would be nice if HZ were NOT a constant and could be dynamic as you suggest but too many braindamaged programs assume 100 Hz for Linux.

    4. Re:Now if only we can get Linus to up HZ to 1000 by Anonymous Coward · · Score: 0

      Too bad HZ is not dynamically settable in /proc. Why is it a constant in the first place?

  29. I can't believe it's not by Anonymous Coward · · Score: 0

    Following the link, went to LinuxDevices.com to read up on Real Time and Love's interview.

    I press the back button couple of times, intending to read score:5 opinions of the Slashdot crowd, and the first thing I see is copy-and-paste plaigarism of what I've just read.

    You guys should be ashamed of yourselves.

  30. New Scheduler by redcliffe · · Score: 1

    The new scheduler and the preemptible patch should work together well. The new scheduler is designed to make interactive tasks seems snappier, so 2.5/2.6 should be a lot faster on interactive stuff.

  31. This is good. by StarBar · · Score: 2, Informative

    Preemptiveness give the kernel the possibility to change direction in the middle of a leap, and later get back to that point to finalize the leap, what ever system call that is. It will of course not do this for no reason, only if an important event has happened that has a higher priority than the current running event. A little like 'nice' but much more powerful. Can't be bad, can it?

    The next thing to have is predicatability in kernel space, then we can calculate the exact max latency to expect between the important event and the systems respons to it... belive it or not. Check out with Monta Vista for this feature, I am sure they are thinking about it.

  32. Desktop focused by clenhart · · Score: 1

    This is a (good) sign that Linux is more interested in the Desktop than before. Adding this feature probably will slow down Linux servers since there is more overhead, but will make desktop machines appear faster. I am glad to see that desktops are taking priority over servers.

    1. Re:Desktop focused by TeknoHog · · Score: 1

      This feature is optional, chosen along with other configurable items. Servers will not be slowed down unless chosen to do so.

      --
      Escher was the first MC and Giger invented the HR department.
    2. Re:Desktop focused by Anonymous Coward · · Score: 0

      You know, I hear they can turn off this feature if they want to.

  33. Re:You are currently not eligible to Meta Moderate by Anonymous Coward · · Score: 0

    552191

  34. Maybe you could call it Direct Rendering Interface by lkaos · · Score: 5, Informative

    Oh wait, that name's already taken as it's been a part of XFree86 by default since the 4.0 release!

    Man, people piss me off sometimes... I wish people would actually read something about X before bitching about it on /.

    I don't know why people think X is so horrible. X just destroys Windows as a windowing system. The only plus Windows has it that it has better hardware support. Other than that, X blows Windows away.

    And this got mod'd up to 4... Sheeesh

    --
    int func(int a);
    func((b += 3, b));
  35. Really "Preemptible"? by KidSock · · Score: 2

    Doesn't this patch just add a bunch of extra schedualling points in stategic places? That's not technically "preemptible". Or perhaps I'm thinking of one of the other "preemptible" kernel patches :~)

    1. Re:Really "Preemptible"? by be-fan · · Score: 2

      That's not the preemptible patch. That's the low latency patch.

      --
      A deep unwavering belief is a sure sign you're missing something...
  36. Re: clueful? by jeffehobbs · · Score: 1


    I hate the fake word "clueful". It's a stupid, obnoxious word.

    Please don't let it catch on.

    ~jeff

  37. Re: clueful? by sydb · · Score: 1

    I hate the fake phrase "catch on". It's a stupid, obnoxious phrase.

    Please don't let it become popular.

    --
    Yours Sincerely, Michael.
  38. Technical Overview by lkaos · · Score: 5, Informative

    Four keys terms to know:

    1) Pre-emptive
    The operating system can interrupt the currently running process to allow another process to run

    2) Co-operative multi-tasking
    A task gives control back to the operating system in order to let more programs run.

    3) User Mode
    On most platforms, an execution state with limited hardware and memory access.

    4) Kernel Mode
    On most platforms, an execution state with direct access to all system resources including page tables and hardware.

    Win3.1 runs entirely in Kernel Mode and uses co-operative multi-tasking.

    Win9x runs entirely in Kernel Mode and uses pre-emptive multi-tasking.

    WinNT based systems (including Win2k) uses pre-emptive multi-tasking and supports both user mode and kernel mode.

    Linux uses pre-emptive multi-tasking and supports both user mode and kernel mode.

    Now, a system that has pre-emptive multi-tasking can either only allow pre-emption to occur in user mode, or in both user mode and kernel mode.

    Theoritically, something should not be in kernel mode for a very long period of time and what's being done in kernel mode tends to be very important.

    So, Linus never really was very concerned about kernel mode pre-emptiveness because it's not terribly useful unless you have a horribly inefficent kernel or you require absolute real-time operations. Instead, he wanted to focus on making sure the kernel was as efficent as possible.

    This patch allows one to enable kernel pre-emption, but be forewarned, that it will only increase the total time spent in kernel mode (doing the necessary checks) and it will not have a noticable effect unless you are running very real-time applications. That is why it's disabled by default.

    It's a good thing to have for a kernel, but it's not very useful for the average user. That's why it's a configuration option. The big performance increase people are referring to is because of the new scheduler... That's a different thread though.

    The fact that WinNT has a pre-emptive kernel is not necessarily a good thing. They are undoubtly taking a performance hit for it and since one can't disable it, there is no way to not have it if one doesn't need it.

    I think Linus made a good decision about letting it into the kernel mainline, but I think he also made a good decision about keeping it as a configuration option and not integrating by default.

    --
    int func(int a);
    func((b += 3, b));
    1. Re:Technical Overview by iabervon · · Score: 2

      Actually, Windows has used user mode for programs since at least 3.1. If it were in kernel mode for programs, you couldn't get GPFs-- the system would just die, like it did in DOS.

      According to Robert Love's benchmarks, the pre-emptive kernel actually does perform better even for computation-intensive tasks. Having a pre-emptive kernel just gives the scheduler better control over the system. I suspect that because most syscalls are i/o-related, everything is better becasue either a process didn't do many syscalls, in which case it would get cheated by processes whose timeslices expired during syscalls, or it did i/o, and didn't get its turn back quite as soon as it could.

    2. Re:Technical Overview by mrm677 · · Score: 1

      Just because Win9x gets GPFs doesn't mean they run in user mode. The kernel can use virtual-memory capabilities. GPFs are a result of a page fault. They happen in kernel mode as well.

    3. Re:Technical Overview by jmcnamera · · Score: 1

      Ok, so Windows NT, 2000, CE, and XP have this already.

      What about other UNIXes though? BSD, Solaris, and the such?

      Does OSX inherit this from BSD?

      --
      this is not a sig
    4. Re:Technical Overview by jsse · · Score: 2

      Win9x runs entirely in Kernel Mode and uses pre-emptive multi-tasking.

      It has pre-emptive multi-tasking but you don't feel like using a pre-emptive OS due to the fact that, for compatibility reasons, it also allocates system resources to run DOS and Win3.1-based programs. That's to say your system is still (partly) running in cooperative mode until all 16-bit windows programs release their resource thus still suffered from the pitfalls of cooperative OS until ALL 16-bit Windows programs release their system sources.

      The worst is that total release of system resources from 16-bits programs will never happen because besides apps, there are also 16-bit Windows modules running. Use the WinTop utility available as part of the Microsoft Kernel Toys you may be surprised at just which Windows components rely on 16-bit code! For example, MSGSRV32.EXE, despite the 32 in its name, is a 16-bit module. So is RUNDLL.EXE, in contrast to RUNDLL32.EXE. Another common 16-bit component is MMTASK.EXE, which supports multimedia background tasks.

      This is a typical example I told my students not to answer 'Windows 95/98/ME' as stated in textbook when being asked to give examples of pre-emptive OS. The textbook will quote whatever Microsoft is advertised. :/

    5. Re:Technical Overview by blackwings · · Score: 1

      Actualy, Win3.1 is not entirely cooperative, it uses cooperative multitasking for windows 3.1 programs but preemptive multitasking for MS-DOS applications.

      More information:
      http://support.microsoft.com/default.aspx?scid=kb; EN-US;q11248

  39. words of wisdom by Sebastopol · · Score: 1


    from the first article:

    "I tend to disregard any technical comments when there is bias."

    --
    https://www.accountkiller.com/removal-requested
  40. Berlin, an X Replacement by Metrollica · · Score: 1

    Go take a look at the Berlin Consortium. Berlin could eventually replace X. It could have an X compatibility layer, it is speedier, gives a consistent look on all apps. However, it needs much more development.

    Berlin is a windowing system derived from Fresco, a powerful structured graphics toolkit originally based on InterViews. Berlin extends Fresco to the status of a full windowing system, in command of the video hardware (via GGI, SDL, DirectFB or GLUT) and processing user input directly rather than peering with a host windowing system. Additionally, Berlin's extensions include a rich drawing interface with multiple backends, an upgrade to modern CORBA standards, a new Unicode-capable text system, dynamic module loading, and many communication abstractions for connecting other processes to the server. It is developed entirely by volunteers on the internet, using free software, and released under the GNU Library General Public License.

    Berlin FAQ

    Berlin vs X

    --



    --Metrollica
    1. Re:Berlin, an X Replacement by Anonymous Coward · · Score: 0

      why not just replace x with berlin? berlin looks like it has a future. x will just keep holding us down.

    2. Re:Berlin, an X Replacement by Anonymous Coward · · Score: 0

      Because Berlin sucks, that's why. Berlin hasn't progressed in oh... forever?

  41. Oops by Anonymous Coward · · Score: 0

    I accidentally modded someone down when I meant to mod him up. (No idea how that happened, really!)

    I notice that moderating is irrevocable: I get a moderate control on all posts *but* the ones I have moderated. Thus after you click "moderate" you cannot go back and fix a mistake.

    Thus, this post. It has two purposes:

    a. to complain about it so someone will fix it someday

    b. to give back the guy his karma. Slashdot will notice that I am posting in a discussion I moderated in, (even though I am posting this anonymously, thanks to cookies and/or IP address, not sure which) and then Slashdot will reverse my moderations in this topic.

    1. Re:Oops by Anonymous Coward · · Score: 0

      Welcome to the $rtbl, my friend.

  42. Star Office 5.2 by Flossymike · · Score: 1

    But will it mean that Star Office 5.2 on my 166 with 128M RAM will actually run at a decent speed?

    1. Re:Star Office 5.2 by glwtta · · Score: 3, Funny

      "damn it, I am a preemptible patch, not a miracle!"

      --
      sic transit gloria mundi
  43. X Responsivness by Anonymous Coward · · Score: 0
    I think that 99% of the reports about lack of responsiveness in X11 Applications are not directly related to the X Window System, but most of the times to ATA/IDE Disk device drivers.


    Most of the times I saw people complaining about this problem, I came out to the conclusion that they were not even using the DMA mode and were using the PIO mode to read and write all the data from the hard drive.


    I've allways been using SCSI systems (SCSI Harddrive and CDROM/CDR) and I neven had any responsiveness problems with X11, even with much slower systems. In fact, I find that X11 is a great system and works wonderfuly well.


    If you have an IDE system and are feeling performance/responsiveness problems with X11 applications, then you should use hdparm and set the "-c", "-d", "-m" and "-u" flags.


    For instance the command "/sbin/hdparm -c1 -d3 -m16 /dev/hda" will enable 32bit disk access, DMA and multiple-sector reads of 16 sectors at a time.

    If you want to increase the responsiveness of your system even a little more, you might also turn the "-u" flag on, to enable interrupts during IDE hard drive transactions: "/sbin/hdparm -u1 /dev/hda".


    With this settings I don't think you will continue having performance problems with X11 applications.

    1. Re:X Responsivness by Anonymous Coward · · Score: 0

      Agreed.

      I have a SMP machine that has the horribly out of date P-III 866 processors (I know ,omg how can I even run VI with such low processing power) but I have U160 SCSI.. and it beats the tar out of every computer that doesn't have scsi. (Yes your new P-4 2Ghz machine absolutely sucks compared to my P-3 866... NYAH NYAH!) Why? IDE stinks for performance, always has and always will.. because it's designed for cheap. Yup... it's designed to be cheap and not for performance. If they made it for performance then it would cost the same as SCSI. No I cant tell you the specifics on why, I can just tell you from my expierience with over 500 diferent computers over the past 10 years. SCSI systems always won in performance and most of the time makes a slower machine faster than the latest and greatest processor.

      So in conclusion... if you want a real computer instead of a toy? sink your money into the motherboard first, SCSI card and drives second, Video card third, and the processor dead last. Follow this rule and you'll make all the L33T wannabes with the latest processor look stupid (as they usually are anyways)

  44. Recompile the drivers, they will work. by leereyno · · Score: 3, Informative

    The GLX portion of th nvidia drivers doesn't seem to care what kernel revision you're running on. The kernel module portion does however. I've been running the preempt patch for some time now with several revisions of Nvidia's drivers. Just get the SRPMS and recompile them. Or get the TGZ versions if you're running a non-RPM distribution (slackware, debian, etc).

    I don't know what problems others have or have not had, but I've never had a bit of trouble with the preempt patch.

    --
    Muslim community leaders warn of backlash from tomorrow morning's terrorist attack.
  45. Try FluxBox! by Anonymous Coward · · Score: 0

    If blazingly quick x windows is your thing, try fluxbox!

    http://fluxbox.sourceforge.net

  46. Montavista by Anonymous Coward · · Score: 0

    Montavista, the original creators of the preempt patch, and who basically released it back into the wild for the community to work on, just got quite a bit of money in a new round of financing. Pretty impressive given the current economic conditions here in the US.

    And please, no "nice link buddy, like I couldn't have figured out the Montavista URL on my own" comments... it's just there for convenience ;)

  47. Re: clueful? by Anonymous Coward · · Score: 0

    The above post is clueless. Mod as necessary.

  48. Andrew Morton's patch is better by burris · · Score: 2

    While the preemptible kernel is a more elegant solution to scheduling latency than peppering the kernel with rescheduling checks, Andrew Morton's "Low Latency" patches give better performance. I'm doing 24-bit/96-kHz audio and with the LL kernel I get vastly more stable performance than the PE kernel. Note that you aren't going to see a spit of difference with either kernel unless the process is running at realtime priority (i.e. SCHED_FIFO or SCHED_RR).

    burris

    1. Re:Andrew Morton's patch is better by Anonymous Coward · · Score: 0

      You know what, Burris? When I want music I turn on the radio. No fuss. No muss.

    2. Re:Andrew Morton's patch is better by Error27 · · Score: 1
      There's no reason you can't have both.

      It's been too much bother for everyone involved to make the two patches work together until now. I expect Andrew Morton will update his patches within a few weeks now.

  49. Re:Maybe you could call it Direct Rendering Interf by Anonymous Coward · · Score: 0

    Some poeople should try to program an X toolkit before they defend X.

  50. This is bunk. by Inoshiro · · Score: 2

    As others have pointed out, DRI, DGA, etc all exist. Another thing to point out is the performance of Windows in VMWare. It feels responsive. Why? Simply because the VMWare video driver is smart. It knows how to turn Win32 calls, boil them down into vectors, and send them off to the X11 video driver very quickly. This is why DGA fullscreen Win98 is as fast on my machine as it is navite for video updates (but I've not run Windows natively on my workstation for over a year).

    If you want more responsiveness, fix your toolkits. This is happening in GTK+ v2. Look at the changelogs and code. IF you treat a video card like a framebuffer, you lose out bigtime. If you do everything as a vector op, you save bigtime ! This is (on of the) reason(s) why OpenGL is popular -- it's a vector API for 3D graphics.

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
    1. Re:This is bunk. by Emil+Brink · · Score: 2

      If you want more responsiveness, fix your toolkits. This is happening in GTK+ v2.
      It is? Great. I've been developing a GTK+ app for three and a half years, using GTK+ 1.0 and lately 1.2. Since I'm looking forward to GTK+ 2.0, I recently downloaded a snapshot of the development series (1.3.10) and built it, to try it out. Geeez, was it slow! Now, I don't have any numbers or anything, but based on my experience, the simple list test program I wrote feels 3-5x less responsive than it would be under GTK+ 1.2. Clicking a list item has a noticeable delay before it gets rendered in the selected state. Now, my machine (a K6-233/128) is obviously not a modern day monster, but still. If there are initiatives to make GTK+ 2.0 faster than its predecessors, they sure seem to start by going quite a bit in the opposite direction.

      --
      main(O){10<putchar(4^--O?77-(15&5128 >>4*O):10)&&main(2+O);}
  51. Alpha cpu`s by Bert64 · · Score: 1

    Currently the pre-emptive kernel is unavailable under make menuconfig on an alpha cpu

    --
    http://spamdecoy.net - free throwaway anonymous email - avoid spam!
    1. Re:Alpha cpu`s by Anonymous Coward · · Score: 0

      Who uses that anyway? I thought it was dropped

  52. Re:Maybe you could call it Direct Rendering Interf by MrHat · · Score: 1

    Infrastructure, not interface. And that's used solely for 3D acceleration at the moment.

    The main problem I see with the current UDS based X implementation is not the slowness of the transport, but the sheer amount of protocol data there is to send. With a higher-level tooklit running in the server's address space, we probably wouldn't be having this discussion.

  53. Re: clueful? by Anonymous Coward · · Score: 0

    That's not a terribly clueful reply.

  54. Wait a minute.. by haggar · · Score: 1

    I was always under the impression that the Great 32-bitOS of the Future is, indeed, a preemptive multitasking OS.

    Are you telling me that it was the same as the friggin' Win 3.1 (albeit with memory protection and 32 bits)??

    The sad thing is, when I would point out ot Linux zealots that gzip would slow down X, I would get attacked from right and left with "you don't know how to configure Linux".

    --
    Sigged!
    1. Re:Wait a minute.. by Anonymous Coward · · Score: 0

      I can't believe that anyone with such gratuitous ignorance of the topic at hand would feel like they had something worthwhile to say. I won't correct you here, just read the other posts.
      gzip slows down X because there's a finite amount of processor time, duh. If two things are running they have to share it.

  55. Precompiled? by istewart · · Score: 1

    Is it possible that most of the big distros like RH and Mandrake will compile this into their prerolled kernels? It's probably gonna be a while before the distros sold at retail outlets start using 2.5 (RH and Mandrake are still using kernels earlier than 2.4.10 due to the VM system), but would there be enough of an advantage in desktop responsivness for them to use this by default?

    1. Re:Precompiled? by snoozerdss · · Score: 2, Informative

      Actually Distro's are using 2.4 because it is the latest stable kernel. 2.5 is a developement kernel not intended for everydays use.

      --
      Snoozer.
  56. Correction by DarkAurora · · Score: 0, Redundant

    This has been applied to the development (2.5) tree not the stable (2.4) tree.

  57. Does this mean a definite break with UNIX? by Anonymous Coward · · Score: 1, Interesting
    In kernel hacking documentation I have read that UNIX device drivers are supposed to determine mechanism, NOT policy. For me--someone interested in robotics and bit banging in x86 I/O space without politics--this has been a sad fact of the stuff with "good TCP/IP built in".

    I guess I reasoned that I would always have a sort of love/hate relationship with UNIX and its clones. Then when RTAI and RTLinux came along, that solved that, but it did so (I ASSUME) by philosophically thumbing its nose at UNIX tradition. Ok. So Linus decided to keep the default behavior not preemptable, which makes sense, but--given that the "Linus blessed" Linux version numbers have an optional preemption behavior built in--doesn't that mean a significant parting of company between the Linux kernel and UNIX as people know UNIX to be?

  58. suck by Anonymous Coward · · Score: 0

    Linux Suck
    So do Windows...well, worse!?
    MacOS X doesn't!
    OS/2 huh?
    Be OS history

    and change the 'word' patch with something else...patching isn't good :)

  59. QNX has far lower latency by Animats · · Score: 2, Offtopic
    The right way to do this is in QNX, which only prevents interrupts for a few instructions at a time, typically while updating queues. QNX has a real microkernel; all the kernel does is schedule the CPU and handle interprocess communication. Everything else (drivers, paging, file systems, networking, graphics, etc.) is in protected-mode user processes, all of which are preemptable. This allows QNX to deliver sub-microsecond latency to high-priority processes.

    QNX stands as a rebuke to those who say a microkernel OS has to be slow.

    1. Re:QNX has far lower latency by Mydron · · Score: 1
      QNX stands as a rebuke to those who say a microkernel OS has to be slow.


      That and an obscure little OS called Windows NT/2000/XP.

    2. Re:QNX has far lower latency by Animats · · Score: 2

      The QNX microkernel is about 60K bytes. NT's kernel is somewhere in the megabytes.

    3. Re:QNX has far lower latency by nusuth · · Score: 2
      NT series are not really microkernel. The kernel has far too many jobs than those would be expected in a real microkernel, such as handling video and network.

      That said, I like the mix. Things that need all speed they can get are right in the kernel and nothing else is. That design wins over both pure microkernels and normal monolithic kernels for current desktop computers. I hope as computers continue to speed up, NT kernel evolves to a proper microkernel.

      --

      Gentlemen, you can't fight in here, this is the War Room!

    4. Re:QNX has far lower latency by jazzyjez · · Score: 1

      Actually, NT 4 and later don't have microkernels (for example video drivers run in kernel mode, which is the main cause of the BSOD). M$'s original 3.5 release of NT did, but it went too slowly...

    5. Re:QNX has far lower latency by julesh · · Score: 1

      They are a microkernel based system, but with drivers running at 'priveleged level'.

      The distinction is that drivers are not built as part of the kernel, nor do they run from within kernel calls: the kernel itself only handles communication between them and memory allocation and drivers run as processes.

  60. Re:Maybe you could call it Direct Rendering Interf by WzDD · · Score: 1

    Oh, yeah, X blows Windows away, except for the standard printing architecture, the single widget toolkit (argue for choice all you like, but as far as I'm concerned having up to 5 competing toolkits all visible on my desktop is horrible), the raw speed of the windowing environment (Windows is a whole lot more responsive than X on Linux on my machine, although I would much prefer if the reverse were true), a single sound API (Linux has oss, esound and a variety of other more or less workalikes), even simple things like ABILITY TO CHANGE COLOUR DEPTH ON THE FLY. I love Linux and use it exclusively, but compared with Windows, X is a dog.

  61. Re:Maybe you could call it Direct Rendering Interf by PlaysWithMatches · · Score: 1

    Yeah, it'd just be nice if DRI worked better. :) DRI with my Radeon was so flaky, any speed benefits of it over my crusty ol' GeForce 2 MX were lost. Crashes, hang-ups, graphical glitches...

    DRI is an excellent idea, but its implementation at the moment leaves quite a bit to be desired. If I had the coding talent, I would try to help contribute and improve it... Alas, I cannot.

    --

    Mozilla's a nice operating system, but it needs a better browser.
  62. Whatchew talkin' bout? by clump · · Score: 3, Informative
    I compiled this into 2.4.17 with the preempt-kernel-rml-2.4.17-1 patch. When i booted i got PPP module errors, and when i tried to install the NVIDIA (2314/2313) drivers it gave me more errors. So i went back and disabled it...

    Hrm... I am running that exact setup, and due to ISP/CLEC madness, I am also using PPP for connectivity. In fact, I am writing this dialed in with a 2.4.17-preempt kernel. No issues with all of the above plus a GeForce3 with the newest NVidia drivers.

    So far, I have to say I am very impressed with the performance. I do notice a difference because I have taken to creating Divx;-) movies which proves to be a loborious task. I can rip a DVD and preview the .avi being created with no apparent latency with the preempt patch. Without the patch, previewing the avi is not at all realistic. Hats off to RML and Linus.
  63. Re:Maybe you could call it Direct Rendering Interf by Alomex · · Score: 2

    X just destroys Windows as a windowing system.

    One of the sad, unintended consequences of Linux's popularity is that there is a young generation of geeks out there who think that X-windows is something other than a comedy of errors.

    The toolkit, the inefficiencies in communication, the lack of intelligent control at the terminal side, and the list goes on and on...

  64. How to improve X11 Linux performance on Linux by Anonymous Coward · · Score: 0

    How to improve X11 Linux performance on Linux: change the Linux kernel HZ constant from 100 to 1024 and recompile the kernel.

    Upping HZ to 1000 (or 1024) helps significantly make Linux scheduling appear to be much faster - it also greatly helps X11 applications. The X11 event loop is, after all, waiting on a select() (or poll). When HZ is 100 (default on Linux/x86) the minimum sleep interval for poll/select in the X11 event loop is 100/2 or 1/50th of a second. When HZ is set to 1024 the X11 event loop can be checked in increments of 1/512th of a second.

    It works quite well. Best kept secret for Linux.

    The real question: why is HZ still defaulted to the bloody low value of 100 for Linux/x86 in this age of multi GHz machines anyway? The alpha/Linux kernel has used a HZ constant of 1024 since the beginning.

    1. Re:How to improve X11 Linux performance on Linux by Anonymous Coward · · Score: 0

      Alan Cox is also in favour of upping HZ or getting rid of it altogether - take a look at this thread. In one posting he says it would improve the quality of both games and MIDI music.

  65. X might blow Windows away for you by tlhf · · Score: 1
    I don't know why people think X is so horrible. X just destroys Windows as a windowing system. The only plus Windows has it that it has better hardware support. Other than that, X blows Windows away.
    Seriously. Maybe if you're running XFree86 on your whizzedy-pop [Athlon|PIII] box, but some of us are poor ass students who get whatever's given to them. Sometimes literally.

    I'll try not to boast, but I for one have a state of the art (circa-never) Cyrix 300 (running at ~216MHz), 128mb of RAM, and an ATI XPert 98. When I'm using Windows 2000 I get a fairly responsive system - IE is quick, loading in about 3 secs, Word doesn't seam too slow, also loading in 3 secs. Editplus, WMP6 and WinAmp load in roughly a second each. Windows/Mozilla appeared in on 12 seconds.

    When on Linux/X/KDE2 the system was far from snappy, and close to being unusable. X/Mozilla loaded in about 25 seconds, XEmacs in about 8, Konquerer in about 10, XMMS in about 6. I tried Gnome at one point, and it was a little faster, but still far slower. But it wasn't just boot times; XFree86 couldn't resize in realtime in any sense. Resizing a slashdot window in Windows/IE is no problem, and at a very rough estimate about 10fps, and even Windows/Mozilla at a usable 5. For me it's a completely different story under XFree86: Mozilla and Konquerer both resized at about 1fps, which is unusable.
    Man, people piss me off sometimes... I wish people would actually read something about X before bitching about it on /.
    I will be honest with you - I've probably spent less than half an hour reading XFree86 docs. But does that mean I can't critique it? Does that mean that when I'm using it that it's of an acceptable speed? Does it fluck.

    tlhf

    Notes to the possible responses:
    Yes, I have used [Gnome|TWM]. Yes, I will accept it's faster than KDE2. No, it's still not as fast. No, I'm not astro-turfing, in fact I prefer BeOS. If only BeOS had multi-user support and memory protection. Long live Glass Elevator! The system those times are off was Mandrake 8.0. I've also run DemoLinux 3 on my PC, and FreeBSD. XFree86 was still slow. Yes, all those times are fairly rough estimates, and probably upto 75% off each. No, this doesn't make my point wrong. Any idiot with a slow PC will tell you XFree86 is s l o w. Yes, all those tests were done on a first run, no caching. I'm not thick. Except maybe IE, which manages to have itself constantly cached due to half being in the OS. Yes, the memory usage was about the same on both (roughly 80mb after a boot). Yes, I know parts of the Win2k GUI are at a lower level than X. And yet I don't care, for my desktop PC
    1. Re:X might blow Windows away for you by wct · · Score: 0, Flamebait

      Maybe you should consider getting a video card with accelerated X support. If you're even using X 4.0 at all.

    2. Re:X might blow Windows away for you by CaptnMArk · · Score: 1

      >Resizing a slashdot window in Windows/IE is no
      >problem, and at a very rough estimate about 10fps,
      >and even Windows/Mozilla at a usable 5. For me it's
      >a completely different story under XFree86: Mozilla
      >and Konquerer both resized at about 1fps, which is
      >unusable.

      You are right. But in my experience (I had the same card too once) this cannot be blamed on X, but mostly on the toolkits (Qt,mozilla-xul) and on the applications themselves.

  66. Linker slow by aashenfe · · Score: 2, Insightful

    The linker definitly needs some work on linux. Program startup can be painfully slow especialy when using KDE (C++). This really gives the feeling of a slow system, even though when the programs are finally started, they run rather snappy.
    Redhat 7.2 has a prelinker utility on the cdrom although it is unsupported. I tried it out. Installed it, and ran the prelinker on all binaries in the default path (it appears to include most libraries and binaries). The improvement was negligible if even there.

    Any Ideas on how this could be improved in the future. I have two ideas that I can think of to improve the linking performance, or at least improve the feel of the linking.

    1. Memory pages that are linked, but not dirty(Havent been updated since) could be marked as part of a link cache. For instance the same program starting up could just ajust it's page table to point to the already linked page, and update the page count. The page would then be copy on write. These pages would be usable until the reference count is zero, and the system needs the page for other purposes. This would impove load speed as long as the program was previously used, and it's pages haven't been used for other purposes. This would be great for multiple use systems like a terminal server. I don't know if this is possible, or already been done, and I'm behind the times.

    2. Simple start up tricks. For instance the window manager opens a frame where the program is going to start up. The frame would contain a throbber, status bar, etc. The frame would resize once the program connects to the Xserver to surround the first window of the application.

    I hope these posts aren't too off topic.

    Thanks.
    Adam

    1. Re:Linker slow by abdulla · · Score: 1

      I can't say I really know, but I thought more the problem with KDE was the way C++ links, and that that linking isn't supported well, and considering the way a lot of kernel people are anti-C++, i don't think this will happen soon, then again I could be wrong about everything.

  67. Re:Maybe you could call it Direct Rendering Interf by Anonymous Coward · · Score: 0

    You, sir, are a comedy of errors. Therefore, I would appreciate it if you would refrain from making defamatory statements about the X Windowing System until you have some clue about what you are talking about, starting with the fact that the name of the standard UNIX windowing system is not X-windows, but X, X11, or the X Windowing System.

    Thank you, and have a lousy day.

  68. Compile problems with 2.5.4 ! by Anonymous Coward · · Score: 0

    When trying to compile 2.5.4 with the pre-emptible patch turned on, I get the following error. Anyone have any idea? I'm running debian, latest unstable, and are running kernel 2.5.3 ATM.

    /usr/src/linux-2.5.4/include/asm/processor.h: In function `thread_saved_pc':
    /usr/src/linux-2.5.4/include/asm/processor.h:444 : dereferencing pointer to incomplete type
    /usr/src/linux-2.5.4/include/asm/processor.h:445 : warning: control reaches end of non-void function
    make: *** [init/main.o] Error 1

    Is this affecting more than 1 user? :)

    1. Re:Compile problems with 2.5.4 ! by Anonymous Coward · · Score: 0

      Asshole, if you can't fix it, then don't use it.

  69. no it's a little different by Otis_INF · · Score: 2

    Pre-emptive multitasking is ment for tasks that run ON TOP of the kernel, since the kernel does the scheduling :) That works for ages in all kinds of OS-es, also Linux.

    Now, what about tasks that are part of the kernel? Are these run in a pre-emptive multitasking environment? Some OS-es don't and some do. Most OS-es have a different kind of scheduling of tasks within a kernel, so a kernel can predict when a kerneltasks is finished and can prevent kerneltasks from stalling the overall systemperformance. What is done here, is that by this patch, Linux got a pre-emptive scheduler for kerneltasks, so these are scheduled on a different way than before, resulting in better overall performance.

    Your gzip-X problem has nothing to do with it: if 1 program hogs the cpu, another can't fully use it.

    --
    Never underestimate the relief of true separation of Religion and State.
    1. Re:no it's a little different by vidarh · · Score: 2
      This is not an accurate description of the preemtive kernel patch. The patch has nothing to do with scheduling of kernel threads, but with allowing user processes to be preemted while they're executing kernel code.

      In a typical Linux program a process keeps transitioning in and out of the kernel. Whenever you use a syscall (for instance by reading from a device), the process executes kernel code. Without the preempt patch, whenever the code enters the kernel it can't be preempted until it exits. It can loose the CPU, but only where someone explicitly have made the kernel code yield the CPU .

      What the preempt patch does, is making it possible for the kernel to preempt a process at any time, including within the kernel, except when executing code where the kernel is explicitly being stopped from doing so (by locks, by turning off interrupts, etc.). The reason this doesn't break too much stuff is that there's aready a lot of locking in place in order to ensure the kernel works on SMP systems.

  70. Not correct. by Otis_INF · · Score: 2

    Win9x doesn't run entirely in kernelmode. It runs 32bit processes in usermode and it's own modules in kernelmode.

    The NT kernel is partly pre-emptive because it's build up by a very small core that only does scheduling and very low level stuff. All other kernelprocesses are tasks on top of that small core. So you can implement the scheduling between these parts as a pre-emptive scheduler. BECAUSE it's pre-emptive it's so fast. The NT kernel isn't eating more performance than needed, it's more faster than comparable kernels. This has been tuned in win2k and in XP. In XP f.e. the locking mechanism which is holding back NT's kernel has been greatly enhanced. Locks are the nail on the pre-emptive-kernel-coffin.

    Linux has a big kernel, it's not implemented as a small core that simply does very very low level stuff and scheduling, it does a lot more.

    --
    Never underestimate the relief of true separation of Religion and State.
    1. Re:Not correct. by lkaos · · Score: 2

      I knew this would happen :)

      I should have clarified.

      I used the words user mode and kernel mode not to mean protected and real mode (as often thought in the x86 world) but to define different execution states.

      There is no protection mechanism for any of the kernel data in Win9x. Every process has read/write access to all resources. So, a lot of the aspects of the kernel that normally would run only in kernel mode (real mode), are actually running in user mode (protected mode) such as WinSock.

      There is no clear definition between user mode verses kernel mode in Win32. All processes are _essentially_ running in kernel mode.

      The nominative word is essentially though :)

      --
      int func(int a);
      func((b += 3, b));
    2. Re:Not correct. by julesh · · Score: 1

      You seem to be a little confused; kernel mode is not in any way equivalent to real mode. Win9x does use memory protection, just not to the extent you would usually expect.

      User mode processes do not have access to directly modify many of the key OS data structures, and run at CR3. The OS kernel (which is really best only loosely described as such) runs at CR0.

      What doesn't exist is protection between processes, and as you rightly point out, many OS features are implemented in user mode.

    3. Re:Not correct. by lkaos · · Score: 2

      Too many bad words...

      I used real mode but that was not correct. I am not familiar with the CRn concept having only worked with the Linux kernel...

      long day i guess :)

      --
      int func(int a);
      func((b += 3, b));
  71. This is due to a restrictive locking system by Otis_INF · · Score: 3, Informative

    The locking system in the NT kernel is very conservative. However even hanging kernelprocesses in NT don't bring down the entire machine, it's just that the kernel can't re-grab locked resources that easily. The introduction of spin-locks in XP removed this problem completely, after the enhanced kernelmode locking mechanism in Win2k's kernel. Locking can bring down any pre-emptive kernelscheduler. So in this light, you might say: ok, the idea is good, but the locking mechanism should have been better. The analysis they've done on the win2k kernel which resulted in the implementation of spinlocks in XP's kernel (and which makes it really fly on SMP systems) could have been done earlier, f.e. on the NT kernel, true.

    --
    Never underestimate the relief of true separation of Religion and State.
    1. Re:This is due to a restrictive locking system by Anonymous Coward · · Score: 0

      Ok, you either know way more than I do, or you are talking a bunch of gibberish. As far as I know, an ill-behaved kernel process can bring down ANY operating system. That is why you try to minimize the amount of code that can run at kernel processor privilege.

      As for NT being preemptible. Yes, it most definitely qualifies as a preemptible kernel. Kernel threads can be preempted by any other thread. The scheduler schedules threads based on dynamic thread priorities, essentially irregardless of processor mode differentiation. However, no, a preemptible kernel in and of itself is not enough to make an operating system a hard realtime OS with an upper bound on exception handling duration. In other words, a kernel can be preemptible but that does not mean that the exception handling mechanism is deterministic.

      As for "spinlocks", it is my understanding that neither NT, 2000, or XP have them in a uniprocessor configuration. Why would they? Rather, resource conflicts on a uniprocessor system are managed by kernel mutex objects and by raising or lowering the IRQL and thereby restricting exception processing in certain situations. Spinlocks, again to the best of my knowledge, are only required in SMP configurations where one needs to manage resources across processors (hence, the "spin" in the name indicating that a processor is just sitting there in a loop waiting for a resource). So, all your comments regarding the introduction of spinlocks in XP made little sense to me. The SMP kernels of NT/2000 also had spinlocks.

  72. Preemption Enhancement Vs. Interrupt Abstraction by sireenmalik · · Score: 1

    Very recently I started evaluating the different approaches to realtime in Linux. As i gather in the Preemption Enhancement "Linux kernel code is modified to reduce the amount of time that the kernel spends in non-preemptible sections of code..."
    As pointed out this approach has problems:
    * increased complexity and hard-to-maintain code.
    * extra context switches can be counter-productive
    * who will track the code-path?
    * This approach places an onus on the kernel developers to put together pre-emptible algorithms which is definetly not easier than developing non-preemptible algorithms. (Logically this woulld cripple the development rate of kernel enhancement and debugging!! )

    On the other hand there is "Interrupt Manager", or the "Micro-Kernel" approach. Its a neat trick by veteran RTLinux hacker Victor Yodaiken. Read more here
    I quote from this source "...entire kernel is made preemptible by having a separate hardware-handling layer intercept and manage the actual hardware interrupts on a system. This hardware abstraction layer has complete control over the hardware interrupts, and simulates the interrupts up to the Linux kernel in a way that allows the kernel to run unmodified on the real-time scheduler. linux kernel remains largely untouched"
    If you want "hard guarantees" you make Linux kernel loadable modules software modules(just like device drivers etc.) otherwise make regular threads in the user space.
    There are arguments against this approach as well-.. "its not linux" , "unique programming model" etc. The most important is ... that there are certain context switch latencies involved when a process is switched into in user space (due to MMU processing overhead, cache line flushes, and other things), that will inherently yield more jitter, and thus worse case guaranteed task switch latencies.
    taking into account the pros and cons of both approaches it seems that balance tilts in favour of "Interrupt Abstraction" approach as from my point of view it should put lesser burden on kernel developers. Can somebody point out to me what was the reason for going otherwise?

    --


    Voltaire: God is dead.
    God: Voltaire is dead!
  73. 14 Years after Amiga by Anonymous Coward · · Score: 0

    Woooow !

    14 Years after the Amiga OS got it -
    Linux finally has preemtive Multitasking.
    Must be really quality code .. *grin*

    bye, Lynxx

    1. Re:14 Years after Amiga by mikera · · Score: 1

      Hey I'm not an expert on Amiga OS internals but IIRC it had pre-emptive *multi-tasking* which is very different from a preemptible kernel.

      The difference is in what gets preempted - in pre-emptive multitasking it is just user-mode programs that get interrupted, wheras with the pre-emptible kernel high priority tasks can interrupt the kernel itself.

      So did the Amiga have a pre-emptible kernel, or was it just preemptive multi-tasking?

      Or was it just a low-latency kernel, which gets you most of the benefits of kernel preemption from the point of view of multimedia apps?

      If it was just multi-tasking/low latency, that's not exactly a big deal as most OSes have had that for years.....

    2. Re:14 Years after Amiga by Anonymous Coward · · Score: 0

      Ah the Amiga, those were the days. It's true: I started out with an A500 with a 7Mhz 68000 CPU, and until I started working on ia32, I didn't know what "stuttering music playback" was!

      I could run dozens of screens doing crazy graphics things all at once, and loading a new program didn't seem to slow down the other ones that were already up because of drive access and such. It certainly made multimedia possible on woefully underpowered hardware back in 1987.

      The old Amiga had a preemptible kernel, and it was one of the reasons they were so fast. I remember the hardware was something special, with the special DMA chips for graphics, sound, etc. Just wondering what happened to the original designers of this box... (FYI Matt Dillon, who wrote the Dice C Compiler back in the Amiga days, is now a BSD Guru/Kernel hacker)

      --
      To understand recursion, one must first understand recursion.

    3. Re:14 Years after Amiga by Anonymous Coward · · Score: 1, Insightful

      i think you have no idea what you are talking about.

      the amiga had no kernel at all. there was no difference between kernel space and user space. (ok, some few things had to be done in supervisor mode (eg stop #$xxxx :)), but any application could get supervisor mode if she wanted to) and just look at all the places in exec that simply did
      move.w #7fff, $dff01e (ie stop interupts!)

    4. Re:14 Years after Amiga by Anonymous Coward · · Score: 0

      AmigaOS sure does have a kernel. It's called
      'exec' ..but its not the huge monolithic
      kernel like Linux, its a microkernel - like
      Mach, Quark, QNX or Plan9.

      It is also preemptible. For both the system functions and the 'user'.
      HOWEVER, any program can interupt and take
      control if neccessary... which is why its
      brilliant for hardware banging and also
      home coded mission critical programs....dont
      want to have to worry about the system? good
      just take over and no other services will
      interupt you ever.

    5. Re:14 Years after Amiga by Anonymous Coward · · Score: 0

      The Amiga, since it did not have memory protection, did not have a clear kernel space/user space distinction. Many functions which on a memory protected OS would probably have been kernel syscalls, were on the amiga fully preemptable re-entrant library calls.

    6. Re:14 Years after Amiga by Anonymous Coward · · Score: 0

      Ofcourse do Amigas got a Kernel - The Amiga-ROM (256Kb till 2.0, above 512Kb).

      Also the Programs/Interrupts can be interrupted by higher priority Interrupts.

    7. Re:14 Years after Amiga by Anonymous Coward · · Score: 0

      The Amiga has 256/512KB Rom, ok no memoryprotection - but thats only a MMU-Thing.

      $dff01e is a Read-Register (Interrupt-Request),
      a write will do nothing - only delay for a few cyles.

    8. Re:14 Years after Amiga by mikera · · Score: 1

      OK, so it's kind of "preemptible everything".

      Never knew that - thanks for the info!

  74. [OT] Buying Priorities by Anonymous Coward · · Score: 0
    So in conclusion... if you want a real computer instead of a toy? sink your money into the motherboard first, SCSI card and drives second, Video card third, and the processor dead last.

    RAM should be either the first or the second item. At least it should exist ;) With enough ram and uptime (a few days will do), harddrives do not impact performance much in desktop systems. Money spend on an extra 1Gig of memory pays of much better than money spend on presumed SCSI advantage, which do not actually exist for systems with low IO load. IDE doesn't scale to high loads or many drives but it is almost as good as SCSI for systems with a few drives and low to moderate loads on those drives.

  75. Re:Linker slow -- GCC's fault by egghat · · Score: 1

    not a kernel problem.

    But the GCC people are working on it.

    --
    -- "As a human being I claim the right to be widely inconsistent", John Peel
  76. Robert Love is such a nuce guy... by Anonymous Coward · · Score: 0

    ...he always signs his mail whith Love, Robert.

  77. preemptible kernel patch with FIFO schedualing by Anonymous Coward · · Score: 0

    How does the FIFO and Round-Robin schedualing
    policies compare to the preemtive patch?? I was
    under the impression that any process running at real-time priority in either FIFO or Round Robin would be able to preempt regular processes. Could you clear up the destinction of real time linux priority and policies and how they will be effected after this patch

    1. Re:preemptible kernel patch with FIFO schedualing by Anonymous Coward · · Score: 0

      They arent't directly related. SCHED_FIFO and SCHED_RR are the real-time scheduling classes in Linux and, yes, the scheduler will run a RT task before any other task. Further, as a RT task becomes runnable (wakes up off blocking for I/O, say) it can preempt the running task. The issue, however, is that this can not happen if the current task is in kernel mode. Given any tasks, in fact, nothing can preempt the system until kernel mode returns. This means your RT task won't run until the current task finishes what it is doing (if it is in the kernel, say, executing a system call). Realizing that 50% of the time is often spent in the kernel (I/O bound tasks more, CPU-bound tasks less) this is a big deal.
      With this patch, when an application becomes runnable it can preempt the current task no matter where it is executing. In user space or in the kernel.

      The benefit to RT tasks is a main point of the patch. It is unfair scheduling-wise to not run an RT task as soon as it wants. That is the point of RT, after all. So allowing preemption inside the kernel is important, there. The other benefit is how this same scenerio applies to everything else on your system. When you hit a key, the receiving application can't process it until it gets the CPU and this doesn't happen until the current task is preempted, which, if it is in ther kernel, is not until it completes what it is doing. With the preempt-kernel patch, it can be run immediately.

  78. preemptible kernel patch by Anonymous Coward · · Score: 0

    We have been doing some work with the preemtive patch and by using the latency tool (cat /proc/latency ??) we find that, with an intel dual CPU board that we are using, we are seeing anywhere from 12 to 25 msecs of none preemtible code run from a spin-lock. This is without our application running. When we run our app and a burn program to simulate a heavy load, which may be a little over kill, we see times of 50 -hundreds of msec .... of none preemptable time.
    This is without you breaking spin-locks switch on, when we turned it on performance went south in a big way.

    If I need more responsiveness (deterministic performance), am I at the point of going to a full MontaVista solution??, and if so what exactly does that intail, besides $$, new API...

    Thanks

  79. Don't be a jackass haggar (mario) by Anonymous Coward · · Score: 0

    Linux is gaining the ability to pre-empt the kernel. this will make for very smooth desktop usage once it gets all tuned up. It is also for embedded systems to get better responeses. Linux has always had preemptive multi-tasking for user space applications but not for the kernel itself. Now everything is pre-emptive. Oh and by the way in case you missed this Linux is a 64 bit operating system as well as 32 bit(Alpha, mips,etc). We are still waiting for microsoft in the 64 bit arena(and no a xp alpha does not count). And I think win3.1 used cooperative muti-tasking. Why don't you read up on a subject before making silly comments?

  80. Congrats Robert by Anonymous Coward · · Score: 0

    I come from the days of the Amiga. Very little to date can match it for interactivity today even though my processor is literally 65 times as fast as my Amiga's was. I have trust that your patch will improve the Linux kernel considerably for human interactivity, and the fact that it can be turned off for those solutions that don't require it is absolutely outstanding.
    Kudos and long success!

    1. Re:Congrats Robert by Anonymous Coward · · Score: 0
      I have trust that your patch will improve the Linux kernel considerably for human interactivity
      You shouldn't have too much trust, I applied the patch and have seen no difference at all in common usage.
      Now from the changelog, Robert Love sees the preemption patch as a mere starting point for more low-latency work, so I bet that those who do audio mixing work will be happy when the 2.6 kernel will be released.
      But for "common usage", I doubt very much that we'll see a big difference, the bigger problem is X11 design and it won't change for a looonnng time.. :-(
  81. Good by Anonymous Coward · · Score: 0

    This is a good thing... I think 99% of the people who have misgivings about this approach do not understand the "cons" they put forward, nor would it impact noticably (negatively) on most peoples workloads.
    There are two downsides to the patch. First is that it adds a tiny bit of fastpath work to some parts in the kernel in the shape of manipulating and testing the preempt counter, it does not "add spinlocks to a UP kernel". I would venture (without having done my own measurements) to say this extra work has no noticable effects on any real world workload on a modern processor. (the work done is probably even negated by being able to drop some fastpath tests of current->need_resched)
    The second one is that kernel code can get preempted. (This is also the pro of the preemt patch btw). Now this means that a process in the middle of executing a system call will be stopped and another process will be run, but ONLY when the first process has used its timeslice and SHOULD be preempted, according to the scheduler's fairness policy.
    The downside to this is simply that caches get trashed (the context switch is very minor considering the process would be switched as if it checks need_resched, blocks, or exits the kernel anyway). I would concede this could show a performance degradation in large SMP servers with many running processes but I would be surprised if it were very large.
    The big curfuffle about I/O throughput is basically crap I think. Either someone mistook a conversation about CPU throughput for IO and twisted it around, or some driver / piece of kernel code was broken. There is no reason why disk IO should drop. CPUs have to wait millions of cycles for disk IO. I believe if anything IO bound applications could benifiet (a tiny bit) because a process blocking on IO should have a fairly high priority when the IO completes which means it can get the CPU sooner (if another process is in kernel), submit its IO and sleep again.
    This is also very nice to have early in the development kernel as it should help weed out more SMP locking problems.
    To the previous posts... I thought the point of a server is to respond to its users thus, the more time spent doing that the better (sorry if I misread), also debugging isn't much harder (preempt rules are a very minor superset of SMP rules) but will show up many SMP bugs in UP kernels which is IMO a good thing in development kernels.

  82. Worthless preemptible patch by Anonymous Coward · · Score: 1, Insightful

    I've tried the patch under various kernel versions under heavy desktop/X11 load, and it only makes the problem worse - instead of slowing down the system immediately, the system gets slower on a delay, and disk I/O is done in chunks instead of when it's supposed to be done. All in all, this patch just makes the kernel respond even slower than without the patch. Things like unRARing files or apt-get upgrade-ing the system will slow down X11 to almost an unusable state with this patch, while it is bearable without the patch.

    1. Re:Worthless preemptible patch by Anonymous Coward · · Score: 0
      1. This isn't intended for desktop use- it's for real-time and embedded systems. If you know what you're doing, you can make it work nicely for it though.
      2. Real-time doesn't mean faster under all circumstances. It means deterministic under all conditions and that the worst-case scenerio's timing meets your minimum criteria.
      3. Priorities out of box from the system may cause priority inversions with a preemptable kernel. What you're describing is usually caused by an inversion. Proper scheduling will prevent things like that- and what is acceptable for a non-preemptable kernel and one that is are two completely different things.
    2. Re:Worthless preemptible patch by Anonymous Coward · · Score: 0
      This isn't intended for desktop use- it's for real-time and embedded systems. If you know what you're doing, you can make it work nicely for it though.
      No. This is for desktop use, not for real-time and embedded system. For those things you need better system than just making the kernel preemptible. You need a system which have a better idea about what jobs are more important and allocate cycles to them.

      On the other hand, I'm also using the patch, and the performance gets improved quite dramatically with the patch. If you already have a fully loaded system that don't do anything good (e.g., when you do apt-get upgrade), you can't do any better than to wait (or to say "nice 19 apt-get upgrade"). But other than that, things are much better than ever. E.g., previously just switching workspaces will give me a few microseconds of no-sound esd. Now no such behaviour comes out.

  83. renice -10 X by Anonymous Coward · · Score: 0

    Some where in the voluminous X documentation, you'll see that it says to run it reniced to -10 or so on desktop systems, so that the GUI pre-empts other stuff, just like on windoze or MacOS. No, I don't know why it doesn't provide an option to renice itself (it is usually run as a privileged process, after all), or why desktop-oriented distros don't at least do this for you...

    In combination with the kernel-preemption patch, this provides excellent GUI behaviour on desktops...

  84. mp3 Playback by Anonymous Coward · · Score: 0

    So can you play mp3s now without skipping?

  85. Just an ordinary user experience by Anonymous Coward · · Score: 0

    Just installed the preemtive patch when upgrading to 2.4.17. First impression:
    Box feels much snappier when doing copy work.

    Running 'rsync' (even niced 19) to backup my disks (about 20 gig) always produced delayed response to keyboard input/window opening (all disks IDE here, but dual CPU mobo).

    Now after preemtive patch is installed, the box feels as snappy as if she were sitting idle and waiting for me to tell her what to do.

    Preemtive kernel is a 'must have' for the desktop user' (IMHO).

  86. You have a config problem? by Anonymous Coward · · Score: 0

    Could it be that you have an I/O problem?
    My system is delivering significantly better response under heavy load since I installed preemptive patch.

  87. Preemptible Kernel linux boxes by Anonymous Coward · · Score: 0

    Imagine a Beowolf Cluster of THESE!!!