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."
Giving more time to more demanding applications.
Right now, most applications get "time", even if they don't need them... so, you are "wasting time" being a "good kernel/waiter" by going to your customer (process), and asking if he needs something more, just to wait for a "no" as answer.
With this "fair" approach, the waiter is floating, looking at the dishes and knowing his customers, and will provide attention if the customer ask for it, or if the waiter "feels" that the customer will ask for something if offered...
So, the trick about this "fair multitask" is to mediate, between really greedy customers, and very lazy customers, and give enough time to each, so you, as user, feel that the application you need to run fast, for example, a photo processing application, really gets more cpu's time, than for example, that nifty system tray g-mail email notifier...
So, your overall feeling is better performance with the same hardware.
This can also applies to servers...
Â_Â
What is it about us nerds/geeks that we like things to be completely fair?
Also, lately I've found that life is a lot less stressful when you stop worrying about things being fair or not; and stop worrying that you might have gotten the short end of the stick. Another thing-- all those dreams of grandiosity every nerd/geek has (wooing the beautiful girl, or being the life of a party, etc; but just can't seem to accomplish), you feel far more empowered to do them when you get a full night's sleep, as opposed to staying up running that instance again for the loot, and then being tired the next day. If you treat your school/college work like a game that you want to master (for a very real benefit I might add-- sure, being the best at Fourier transforms might not net you a top NSA job because the government network was brute-forced in 15 seconds by Megatron's minions, but there are more subtle ep33n enhancements that can add up to something similarly lofty in enough time) the point becomes to learn the material not just finish the problems and turn it in. Then you start getting 100's on tests and it feeds back into itself and you know if you want to accomplish something, you can. Then you have fun and try updating your clothing and hair style, and then when you're really cooking you start walking around like a badass because you know you are one. Quite fun actually. But you never get there if you don't learn to give up the petty things (fairness) that get under your skin for the bigger picture of learning to control your charisma.