aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched_fair.c
diff options
context:
space:
mode:
authorDmitry Adamushko <dmitry.adamushko@gmail.com>2007-10-15 11:00:08 -0400
committerIngo Molnar <mingo@elte.hu>2007-10-15 11:00:08 -0400
commit87fefa381ef27f46c1182622ea01eb9504cd2e24 (patch)
tree036336afad61898307bd3699ecdc3bcbdc3850b6 /kernel/sched_fair.c
parent75d4ef16a6aa84f708188bada182315f80aab6fa (diff)
sched: optimize task_new_fair()
due to the fact that we no longer keep the 'current' within the tree, dequeue/enqueue_entity() is useless for the 'current' in task_new_fair(). We are about to reschedule and sched_class->put_prev_task() will put the 'current' back into the tree, based on its new key. text data bss dec hex filename 24388 2734 20 27142 6a06 sched.o.before 24341 2734 20 27095 69d7 sched.o.after Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r--kernel/sched_fair.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index b9e426a8a09f..827a0636525a 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -972,10 +972,11 @@ static void task_new_fair(struct rq *rq, struct task_struct *p)
972 972
973 if (sysctl_sched_child_runs_first && 973 if (sysctl_sched_child_runs_first &&
974 curr->vruntime < se->vruntime) { 974 curr->vruntime < se->vruntime) {
975 975 /*
976 dequeue_entity(cfs_rq, curr, 0); 976 * Upon rescheduling, sched_class::put_prev_task() will place
977 * 'current' within the tree based on its new key value.
978 */
977 swap(curr->vruntime, se->vruntime); 979 swap(curr->vruntime, se->vruntime);
978 enqueue_entity(cfs_rq, curr, 0);
979 } 980 }
980 981
981 update_stats_enqueue(cfs_rq, se); 982 update_stats_enqueue(cfs_rq, se);