On Wed, Oct 31, 2007 at 10:10:32PM +0100, Peter Zijlstra wrote:
Lets say we have two groups A and B on CPU0, of equal weight (1024).
Further,
A has 1 task (A0)
B has 1000 tasks (B0 .. B999)
Agreed its a extreme case, but illustrates the problem I have in mind
for this patch.
All tasks of same weight=1024.
Before this patch
=================
sched_slice(grp A) = 20ms * 1/2 = 10ms
sched_slice(A0) = 20ms
sched_slice(grp B) = 20ms * 1/2 = 10ms
sched_slice(B0) = (20ms * 1000/20) * 1 / 1000 = 1ms
sched_slice(B1) = ... = sched_slice(B99) = 1 ms
Fairness between groups and tasks would be obtained as below:
A0 B0-B9 A0 B10-B19 A0 B20-B29
|--------|--------|--------|--------|--------|--------|-----//--|
0 10ms 20ms 30ms 40ms 50ms 60ms
After this patch
================
sched_slice(grp A) = (20ms * 1001/20) * 1/2 ~= 500ms
sched_slice(A0) = 500ms
sched_slice(grp B) = 500ms
sched_slice(B0) = 0.5ms
Fairness between groups and tasks would be obtained as below:
A0 B0 - B99 A0
|-----------------------|-----------------------|-----------------------|
0 500ms 1000ms 1500ms
Did I get it right? If so, I don't like the fact that group A is allowed to run
for a long time (500ms) before giving chance to group B.
Can I know what real problem is being addressed by this change to
sched_slice()?
--
Regards,
vatsa
-