diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-10-15 11:00:14 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-10-15 11:00:14 -0400 |
commit | 00bf7bfc2eaf775b634774e9ec435d720b6ecee7 (patch) | |
tree | 1f816516361276a56b9dee6b39e90361dc3468be /kernel/sched_fair.c | |
parent | 0702e3ebc1e42576a04d29f8adacf13be825b800 (diff) |
sched: fix: move the CPU check into ->task_new_fair()
noticed by Peter Zijlstra:
fix: move the CPU check into ->task_new_fair(), this way we
can call place_entity() and get child ->vruntime right at
initial wakeup time.
(without this there can be large latencies)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r-- | kernel/sched_fair.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index a9dfb7746c5c..f5f491762e35 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -1007,13 +1007,14 @@ static void task_new_fair(struct rq *rq, struct task_struct *p) | |||
1007 | { | 1007 | { |
1008 | struct cfs_rq *cfs_rq = task_cfs_rq(p); | 1008 | struct cfs_rq *cfs_rq = task_cfs_rq(p); |
1009 | struct sched_entity *se = &p->se, *curr = cfs_rq->curr; | 1009 | struct sched_entity *se = &p->se, *curr = cfs_rq->curr; |
1010 | int this_cpu = smp_processor_id(); | ||
1010 | 1011 | ||
1011 | sched_info_queued(p); | 1012 | sched_info_queued(p); |
1012 | 1013 | ||
1013 | update_curr(cfs_rq); | 1014 | update_curr(cfs_rq); |
1014 | place_entity(cfs_rq, se, 1); | 1015 | place_entity(cfs_rq, se, 1); |
1015 | 1016 | ||
1016 | if (sysctl_sched_child_runs_first && | 1017 | if (sysctl_sched_child_runs_first && this_cpu == task_cpu(p) && |
1017 | curr->vruntime < se->vruntime) { | 1018 | curr->vruntime < se->vruntime) { |
1018 | /* | 1019 | /* |
1019 | * Upon rescheduling, sched_class::put_prev_task() will place | 1020 | * Upon rescheduling, sched_class::put_prev_task() will place |