Re: [RFC][PATCH][2.6.6] Replacing CPU scheduler active and expiredwith a single array

From: Peter Williams
Date: Fri May 28 2004 - 04:27:50 EST


Ingo Molnar wrote:
* Peter Williams <peterw@xxxxxxxxxx> wrote:


-- at the end of each time slice (or when waking up) each task is
given a complete new time slice and, if class SCHED_NORMAL, is put in
a priority slot given by (static_prio + MAX_BONUS - interactive_bonus)


this is the Achilles' heel of approaches that try to get rid of the
active/expired array and/or try to get rid of timeslice tracking. A
CPU-bound task which schedules away for small amounts of time will get a
disproportionatly larger share of the CPU than a CPU-bound task that
doesnt schedule at all.

just try it - run a task that runs 95% of the time and sleeps 5% of the
time, and run a (same prio) task that runs 100% of the time. With the
current scheduler the slightly-sleeping task gets 45% of the CPU, the
looping one gets 55% of the CPU. With your patch the slightly-sleeping
process can easily monopolize 90% of the CPU!

If these two tasks have the same nice value they should around robin with each other in the same priority slot and this means that the one doing the smaller bites of CPU each time will in fact get less CPU than the other i.e. the outcome will be the opposite of what you claim.

This does, of course, not take into account the interactive bonus. If the task doing the shorter CPU bursts manages to earn a larger interactivity bonus than the other then it will get more CPU but isn't that the intention of the interactivity bonus?

Peter
--
Dr Peter Williams, Chief Scientist peterw@xxxxxxxxxx
Aurema Pty Limited Tel:+61 2 9698 2322
PO Box 305, Strawberry Hills NSW 2012, Australia Fax:+61 2 9699 9174
79 Myrtle Street, Chippendale NSW 2008, Australia http://www.aurema.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/