aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched_fair.c
diff options
context:
space:
mode:
authorDmitry Adamushko <dmitry.adamushko@gmail.com>2007-10-15 11:00:07 -0400
committerIngo Molnar <mingo@elte.hu>2007-10-15 11:00:07 -0400
commitd02e5ed8d55e2a2b2735232ea1da40ffbf4c0932 (patch)
treede972b3b1318deb834f61b6dba967ad32845c229 /kernel/sched_fair.c
parent29f59db3a74b0bdf78a1f5b53ef773caa82692dc (diff)
sched: sched_setscheduler() fix
Fix a problem in the 'sched-group' patch for !CONFIG_FAIR_GROUP_SCHED. description: sched_setscheduler() { ... if (task_running()) p->sched_class->put_prev_entity(); [ this one sets up cfs_rq->curr to NULL ] ... if (task_running) p->sched_class->set_curr_task(); [ and this one is a _NOP_ (empty) for !CONFIG_FAIR_GROUP_SCHED ] As a result, the task continues to run with cfs_rq->curr == NULL... no crashes (due to checks for !NULL in place) but e.g. update_curr() effectively becomes a NOP... i.e. runtime statistics for this task is not accounted untill it's rescheduled anew. 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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 12ab9338d563..144f3ef97380 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -984,6 +984,10 @@ static void set_curr_task_fair(struct rq *rq)
984#else 984#else
985static void set_curr_task_fair(struct rq *rq) 985static void set_curr_task_fair(struct rq *rq)
986{ 986{
987 struct sched_entity *se = &rq->curr->se;
988 struct cfs_rq *cfs_rq = cfs_rq_of(se);
989
990 cfs_rq->curr = se;
987} 991}
988#endif 992#endif
989 993