Discover the best of the web!
Learn more about Digg by taking the tour.
What is the Completely Fair Scheduler?
immike.net — A pretty detailed explanation about whats up with the upcoming 2.6.23 Linux kernel release.
471 diggs digg it
Discover the best of the web!
Learn more about Digg by taking the tour.
immike.net — A pretty detailed explanation about whats up with the upcoming 2.6.23 Linux kernel release.
© Digg Inc. 2008 — Content posted by Digg users is dedicated to the public domain.You are viewing a mobilized version of this site...
View original page here
Try now and it should be all good.
First of all, CFS is still a O(1) scheduler, all context switches happen in constant time. All that CFS improves on is the precision of switches; before, the scheduler uses ticks and there are some odd conditions where a process can use a huge amount of CPU time, without ever being taxed for it (for example, if the process enters on the tick but leaves before the tick, it's not charged for the amount of processing time that happened within the tick.
With CFS, we get rid of "Jiffies", "time slices" and "Hz time", and we just do it on raw nanosecond-time. It's "Completely Fair", because it keeps a journal of exactly how long each process has the CPU, and balances that time out amongst processes evenly. We have a billion nanoseconds in a second, with one process running, it gets the whole billion nanoseconds, with two, each process gets half a billion (minus a few nanoseconds used for each context switch), and so on and so forth. This is nothing but an optimization of the previous scheduling algorithm. [For those who are interested, "nice" still works by calculating exact runtime, adjusted for the process's nice level, ahead of time as part of the scheduler's overhead and is even more precise than before.] myfanwy, on 10/10/2007, -1/+3hmm, CFS scheduler; is that a case of redundant RAS syndrome? mmalone, on 10/10/2007, -0/+3@geminitojanus: my understanding is that CFS is O(log n), not O(1), since it uses a red-black tree to organize processes and selects the leftmost node for execution. Search time on an rbtree is O(log n). Am I missing something?
There are other differences from the current O(1) scheduler too. For example, CFS doesn't do any interactive process identification. And with CFS the time quantum is more variable than with the current scheduler since they're partially determined by the amount of CPU time other processes on the box are using. I wouldn't call CFS "nothing but an optimization."
There are also some interesting comments in the discussion thread on Slashdot at http://linux.slashdot.org/article.pl?sid=07/07/31/1457207&from=rss
The problem CK has always had with his patches is that he thinks one way and starts off running. When his staircase scheduler first came out (This predates the 2.6 kernel...I tested it in embedded network devices I was developing at the time), it sucked BADLY for a system under any real load. It worked great for a desktop running a web browser, but do any actual processing and watch out. His other patches introduce stability issues and break compatibility in many cases. This is also why resiser4 has not been adopted to mainline vanilla kernel.
For a good dose of reality, and a history lesson...go read kerneltrap XVampireX, on 10/10/2007, -0/+1DrDabbles is right, It's a great thing to have at least a few people who are less into hacking the kernel but more into how it works :)
I'm a big fan of kerneltrap, read it every week, and sometimes even several days a week.
If his coding style carried over to his scheduler, I would be more inclined to go with the CFS, as everything I've read suggests that while it's not particularly stellar in any one area, it's very competent across a very broad spectrum of usage scenarios.
And how is this spam anyway? It's explaining something which a lot of people have been wondering about (apparently..since lots of people dugg this story). daftman, on 10/10/2007, -1/+2Dig him down if you feel like getting a hammer and smash his head in.
(And Google is your friend)
impressive work
The end result is that Con has been driven from Kernel development by asses like Ingo. Whether CFS is better than SD is irrelevant. What has happened is the guy who spawned the entire process of getting an improved scheduler in the kernel and spent a year overseeing and improving it has his concept stolen by Ingo. Ingo did not want a new scheduler, he wanted his name to be on the current scheduler. When he saw that disappearing he had to take drastic action and he "authored" a new, improved scheduler. All for his own glory.
http://en.wikipedia.org/wiki/Ingo_Molnar
Here is Con's wikipedia page ... dunno why you linked Ingo's?
http://en.wikipedia.org/wiki/Con_Kolivas
Could the scheduler be user-customizable? It seems like one of those things that geeks would like to tweak for their preferred use and most people can just ignore it.
http://kerneltrap.org/node/11776
Interesting -- as I recall (from reading LKML, etc.) was that Con basically took the attitude of "If I can't patch what I want as I see fit and have everyone like it, then I'm taking my toys and going home." At least Ingo was civil -- Con came off sounding like a whiny little playground brat.
Also, Con's staircase scheduler sucked. I'm sorry -- but it did. It was great if you were running a light-use setup (a desktop environment and a browser/text-editor or so), but if you put it under any real load it crumpled under the strain. This is, of course, totally unacceptable for a kernel that finds its way onto millions of high-load servers. When people pointed this out to Con, his reaction was basically: "No. It's good. Trust me -- I know it's good." instead of "Oh. Hmm... how can I improve my algo?" See the difference? One makes you sound like an arrogant prick (not a good thing for a cooperative project like Linux), the other makes you sound like a valuable asset to any team.
What should he have done? "Good show old chap!"???! Thieves and liars don't deserve "civil" -- they deserve the blunt truth.
It's linux, where everything is ***** open and everyone copy from each other. Knockoffs are common and especially when they improve on your own work. If he has that mentality, why the ***** did he program for linux and not start his own company or work for a proprietary company where they guard their "originals" like hawks.
There is no thieves are liar. It sounds like you are getting too emotional on something that is purely technical. Con is not a team player, that's all. SteveMax, on 10/10/2007, -0/+2So, you're saying that, to Con, having "his" scheduler on the kernel was more important than having the best scheduler on the kernel? Why does it matter who wrote it, as long as it's GPL'd and good? For the comments I see here, CFS manages higher loads better than SD did, and performs just as well under desktop environments. Someone improved on his idea, and that idea is going to the kernel. He should be happy, not be a bitch about it.
Think about it: you get a patch that breaks the kernel under high loads. You ask the maintainer to fix that behaviour. He doesn't do so for over a year, and keeps sending new versions with the same behaviour. You get fed up, and do the job yourself. If Con wasn't an ass about it, his scheduler could have been merged.
That was profound, almost as profound at http://www.thatsprofound.com crossers, 18 hr 51 min ago, -0/+0as I can't read the article, cause link not works. so no comment!
http://www.shpe-sac.org
http://www.ocflex.com/
http://www.trgovinca.org
http://www.chasr.org/
Create a new account or login to join in the conversation on Digg. You'll also be able to Digg stories to help promote things you like.