The Completely Fair Scheduler 292
hichetu writes "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."
SMP and RT capabilities? (Score:2, Interesting)
On another not[e], when are we going to be able to build a default kernel capable of low latency I/O for A/V work?
I/O prioritisation (Score:5, Interesting)
Re:I/O prioritisation (Score:5, Interesting)
Re:Isnt this called Cron ? (Score:5, Interesting)
> let them decide which follows?
That is actually the kind of question that my Operations Research professor (who also did a lot of work in CPU simulation and performance estimating) used to throw onto final exams as the "separate the B+ from the A" question. If your answer was interesting enough he would send you over to one of his Masters candidates to see if it could be taken any further. So I wouldn't count your suggestion out from the start!
sPh
The Multics scheduler always seemed very nice (Score:4, Interesting)
So interactive tasks naturally floated to the top and compute bound tasks naturally sank.
(Anyone remember Multics?)
Comment removed (Score:5, Interesting)
Re:I/O prioritisation (Score:2, Interesting)
I read an article somewhere on Sun's site about I/O scheduling in SunOS, but unfortunately I can't find it now. I'll try to summarize it. The basic point was that when a task wants to write data, it can typically hand that data off to the kernel and then keep running. That means that it's making best use of system resources, since it will use the processor (for example) while the kernel writes to the disk in the background. When a task wants to read data, however, it usually can't do anything until the data's read from disk. So what SunOS will do is schedule I/O unfairly, prioritizing reads over writes, to minimize the amount of time that tasks spend blocked. (My experience is that it will even aggressively swap out pages to expand the write cache.) I wish I could find that article, I seem to remember it having some interesting nitty-gritty details about the way this is actually implemented, as well as some benchmarks from a customer.
Re:I/O prioritisation (Score:5, Interesting)
Linux really doesn't need a new process scheduler. What it could really do with is I/O prioritisation.
QNX has that, which is essential for real-time work.
QNX has the advantage that I/O, like almost everything else in QNX, is done via inter-process message passing operations. The message passing system uses priority queues, and so requests to file systems and devices get handled in priority order. So resource managers (file systems, device drivers, etc.) don't have to explicitly handle priorities; it's done for them. Some resource managers, like disk handlers, process multiple requests at a time so they can reorder them to optimize access, but network devices and such are FIFO at the resource manager level and priority ordered at the message level.
The end result is that you can compile or surf the web on a system that's also doing real time work without interfering with the real time tasks.
Linux "iostat" (Score:1, Interesting)
Re:Well duh (Score:3, Interesting)
Actually I find the Windows (XP, haven't tried Vista yet) scheduler to be quite horrible especially with regards to interactivity. One resource hog and things pretty much come to a standstill. IMO it's worse than O(1) and no comparison to Con's staircase.
Re:Isnt this called Cron ? (Score:5, Interesting)
sPh
Re:I/O prioritisation (Score:1, Interesting)
This is very impressive (Score:3, Interesting)
I'm impressed. I did some work on CPU dispatching on a mainframe system in the distant past, and we were never able to beat O(log n) on an ordered dispatch queue. The obvious implementation is O(n); getting to O(log n) requires a tree, and I want to see how they got to O(1).
This stuff really matters now. If we're going to have 80-CPU multiprocessors, all the main operating system algorithms have to be near O(1), or the scale-up is a lose.
Re:I/O prioritisation (Score:3, Interesting)
Re:I/O prioritisation (Score:4, Interesting)
Actually, that was the Mars Pathfinder [berkeley.edu]. It was running VxWorks, and the effect of the priority inversion was that the stall timer would trip and reset the whole system. The problem was that VxWorks, like QNX, lets you turn off "priority inheritance" on a mutex. This is usually a bad decision, but that was done on the Mars Pathfinder, and created the possibility of a livelock.
So they uploaded a patch to change that mutex to "priority inheritance on", and it worked consistently thereafter.
Re:Isnt this called Cron ? (Score:4, Interesting)
"Progress" has saved us all of that stress and ambiguity.
Now, you just pay a small mountain of cash for tuition, and walk away with your "A".
It's all about efficiency these days.
Re:Isnt this called Cron ? (Score:5, Interesting)
Of course, with such a scheduler, something like the Doom system administration tool [unm.edu] (perhaps more like Quake where you can aim vertically as well as horizontally) will become the preferred method of managing the processes on a system.
For one thing, the processes will obviously shoot back, as the process manager itself (which you see as yourself when running it) is a running process, and thus subject to being fired upon by the other processes.
Secondly, a headshot obviously gets you a "lobotomize" effect. This could pose a problem if one of the other processes hits you with a headshot...
Finally, the application of a medpack to an injured process invokes the "medicate" action.
There are a few possible problems with this, of course:
In short, Linux will quickly become the must-have operating system for gamers, but at the expense of the general purpose desktop.
Re:Isnt this called Cron?^H^H^H^H^H^H Tron? (Score:2, Interesting)
This reminds me of a movie called Tron.
Re:Isnt this called Cron ? (Score:1, Interesting)
> I want it to give ME all the resources I need to get whatever I'm doing done before I even think of it.
> Any other job can just go jump on its head...
I recommend DOS!
Either that or classic Mac OS - you can completely take over the computer from the OS, which is in fact how MkLinux and A/UX are booted.
Re:Isnt this called Cron ? (Score:3, Interesting)
Sure. It demonstrates that you've learned something and that you are a quick thinking and creative person. Your writing ability also plays a major role.
Unfortunately, you could learn the material without being creative, quick thinking, or a good writer. If you are this unfortunate sole you just got a lower grade. Grades are supposed to demonstrate understanding of the course material, not how bright you are.