Slashdot Mirror


Linux Gets Completely Fair Scheduler

SchedFred writes "KernelTrap is reporting that CFS, Ingo Molnar's Completely Fair Scheduler, was just merged into the Linux kernel. The new CPU scheduler includes a pluggable framework that completely replaces Molnar's earlier O(1) scheduler, and is described to 'model an "ideal, precise multi-tasking CPU" on real hardware. CFS tries to run the task with the "gravest need" for more CPU time. So CFS always tries to split up CPU time between runnable tasks as close to "ideal multitasking hardware" as possible.' The new CPU scheduler should improve the desktop Linux experience, and will be part of the upcoming 2.6.23 kernel."

10 of 274 comments (clear)

  1. Neato by friedman101 · · Score: 4, Insightful

    What sort of gain can the typical linux user expect because of this?

  2. Kernel building is pretty fast by EmbeddedJanitor · · Score: 3, Insightful
    Should take you less than 15 minutes to get there again.

    If you really want a rough time, see how long it takes to rebuild a different OS.

    --
    Engineering is the art of compromise.
  3. Re:For the attention of karma whores by garcia · · Score: 4, Insightful

    The sad thing is that the summary reads almost identical:

    "Kernel trap has a nice summary of what is going on behind the scenes to change the Linux Scheduler. The O(1) Linux scheduler is going to be changed so that it is fair to interactive tasks. You will be surprised to know that O(1) is really too good not to have any side-effects on fairness to all tasks."

  4. Re:Cool by HairyCanary · · Score: 3, Insightful

    Ha, I was about to come in and say the same thing. I've always been disappointed in the Linux scheduler compared with my Solaris servers. I run an ISP and frequently get abnormally high load spikes -- my Linux servers handle the load poorly, degrading all of the sudden to gridlock. The Solaris servers, on the other hand, degrade gracefully, still serving up requests but getting slower as the load skyrockets.

  5. Poor attribution by the_greywolf · · Score: 3, Insightful

    So little credit is given to Con Kolivas, whose Staircase Deadline scheduler (a more mature and refined design than CFS) spurred Ingo to finally improve his scheduler (which he wrote on the spot because, apparently, Con's scheduler wasn't good enough for him).

    And all Con gets is a minor footnote.

    --
    grey wolf
    LET FORTRAN DIE!
  6. Re:CFS vs. O(1) by SillyPerson · · Score: 4, Insightful

    Am I the only person worried that the main author of CFS does not seem to understand big O notation and red-black trees?

  7. Politics are destroying Linux too by TeXMaster · · Score: 4, Insightful

    How does CFS work? CFS follows an approach similar to Con Kolivas' SD project:

    Too bad that the NIH syndrome hit Linux Kernel development too, and Ingo Molnar, after blocking all the attempts to merge SD into mainline because "it couldn't be done", uses the same idea, whips out his own scheduler calling it "Completely Fair", and woosh it gets merged (easily, given that Ingo Molnar himself is the maintainer of that part of the kernel).

    Con Kolivas is (obviously and justifiably) disgruntled, to say the least, he stops working on the SD project, and Linux loses an excellent developer because of politics.

    --
    "I'm never quite so stupid as when I'm being smart" (Linus van Pelt)
  8. Re:You mean for.... by CmdrGravy · · Score: 3, Insightful

    I think there's a reason it's called the American Dream and not, for instance, the American Reality.

  9. Angsty nerds are not destroying Linux by Per+Abrahamsen · · Score: 5, Insightful

    Well, given that he is the maintainer, Ingo Molnar's code is presumably more maintainable. It happens all the time in free software projects, someone submits a patch, the idea in the patch is good, but the section of the code is important enough that the maintainer must be certain he understands it. Rewriting it is a good way to gain such understanding.

    Back when I was a maintainer, I guess I rewrote half the patches I got. Most submitters are just happy to see the functionality in there, but there was a few people with fragile egos take it as a personal insult That happens, life goes on, and usually the fragile egos grow more robust with time, and learn that developing what amounts to a prototype of the final code is also a valuable contribution.

  10. Re:CFS vs. O(1) by Ingo+Molnar · · Score: 3, Insightful

    (To answer your question: the 20-21 comes from other limits to the task space - right now we are still limited to 32k pids.)

    Yes, you are right, operations on an rbtree of an arbitrary data structure are of course an O(log2(N)) algorithm, no argument about that.

    I know what the mathematical meaning and definition of the big/little ordo/theta notations is (probably better than i should ;), I only wanted to point out the fact that an O(log2(N)) algorithm for most data structures in the kernel (or elsewhere on today's computers) is equivalent to O(1) in practice, especially if N is fundamentally limited to 15 bits like in this case!

    The main purpose of the ordo/theta notations is to be able to talk about and compare the performance (worst-case/best-case/average-case) qualities of algorithms. Sticking to their strict mathematical definition in cases where it departs from their original purpose results in worse software :)

    And talking about big ordo differences between algorithms operating in finite machines still makes sense (naturally): for example, O(sqrt(N)) is not equivalent to O(1) in practice - it can still be very large, even with a pretty limited N. O(N) is also obviously very relevant in practice, even on very limited machines. But the difference between O(log2(N)) and O(1) is insignificant in most cases, and in fact it is deceiving in this case. (as i pointed it out with the O(140) example.)