Questions about linux scheduler
Posted: Fri Jun 29, 2007 10:20 am
Recently I was thinking about updating my scheduler to include priorities. I wanted to look at some example code so I consulted the Linux scheduler(the original one and not the new one from version 2.6.) After reading over it several times I am finally starting to understand it, here is what I understand it as doing so far(correct me if I am wrong):
1. It looks through all of the tasks in the runqueue to find the one with the highest counter value
2. If all of the task's counters are equal to 0, the scheduler recomputes the counter value for each of the tasks( counter = (counter >> 1) + priority ).
Now the thing about the scheduler is this, since it doesn't recompute the counter value until all of the counters are 0 doesn't that mean that all of the low priority tasks will get a chance to run before any high priority tasks run(if they have used up their time slice)? If that is true then all it would take is 3 or 4 low priority tasks to completely block any high priority tasks for almost half a second or more.
Can someone help me to understand this a little better or recommend a better scheduler to look at?
Also I have looked and looked on Google for a place where I can view the 2.6 kernel source online and I have yet to find anything. Can anyone give me a link? I am asking because the source is 42mb and I have slow speed internet.
Thanks,
Frank
1. It looks through all of the tasks in the runqueue to find the one with the highest counter value
2. If all of the task's counters are equal to 0, the scheduler recomputes the counter value for each of the tasks( counter = (counter >> 1) + priority ).
Now the thing about the scheduler is this, since it doesn't recompute the counter value until all of the counters are 0 doesn't that mean that all of the low priority tasks will get a chance to run before any high priority tasks run(if they have used up their time slice)? If that is true then all it would take is 3 or 4 low priority tasks to completely block any high priority tasks for almost half a second or more.
Can someone help me to understand this a little better or recommend a better scheduler to look at?
Also I have looked and looked on Google for a place where I can view the 2.6 kernel source online and I have yet to find anything. Can anyone give me a link? I am asking because the source is 42mb and I have slow speed internet.
Thanks,
Frank