diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2008-06-27 07:41:37 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-27 08:31:46 -0400 |
commit | 83378269a5fad98f562ebc0f09c349575e6cbfe1 (patch) | |
tree | 516128bff6cfe915f93b983e3fe96733707ce09c /kernel/sched.c | |
parent | 243e0e7b7d3b54749ece2e879ecd7e2a11874443 (diff) |
sched: correct wakeup weight calculations
rw_i = {2, 4, 1, 0}
s_i = {2/7, 4/7, 1/7, 0}
wakeup on cpu0, weight=1
rw'_i = {3, 4, 1, 0}
s'_i = {3/8, 4/8, 1/8, 0}
s_0 = S * rw_0 / \Sum rw_j ->
\Sum rw_j = S*rw_0/s_0 = 1*2*7/2 = 7 (correct)
s'_0 = S * (rw_0 + 1) / (\Sum rw_j + 1) =
1 * (2+1) / (7+1) = 3/8 (correct
so we find that adding 1 to cpu0 gains 5/56 in weight
if say the other cpu were, cpu1, we'd also have to calculate its 4/56 loss
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Cc: Mike Galbraith <efault@gmx.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 62db0891025a..01d3e51b7116 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -365,6 +365,10 @@ static inline void set_task_rq(struct task_struct *p, unsigned int cpu) | |||
365 | #else | 365 | #else |
366 | 366 | ||
367 | static inline void set_task_rq(struct task_struct *p, unsigned int cpu) { } | 367 | static inline void set_task_rq(struct task_struct *p, unsigned int cpu) { } |
368 | static inline struct task_group *task_group(struct task_struct *p) | ||
369 | { | ||
370 | return NULL; | ||
371 | } | ||
368 | 372 | ||
369 | #endif /* CONFIG_GROUP_SCHED */ | 373 | #endif /* CONFIG_GROUP_SCHED */ |
370 | 374 | ||