Skip to contentSkip to conversation

sched: Fix update_curr_rt()

tip:sched/urgent tip-bot for Peter Zijlstra 1 participant 1 message Feb 3, 2011

lore
Share & tools
lore
#0 lore raw
Commit-ID:  06c3bc655697b19521901f9254eb0bbb2c67e7e8
Gitweb:     http://git.kernel.org/tip/06c3bc655697b19521901f9254eb0bbb2c67e7e8
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Wed, 2 Feb 2011 13:19:48 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 3 Feb 2011 12:21:33 +0100

sched: Fix update_curr_rt()

cpu_stopper_thread()
migration_cpu_stop()

    __migrate_task()
      deactivate_task()
        dequeue_task()
          dequeue_task_rq()
            update_curr_rt()

Will call update_curr_rt() on rq->curr, which at that time is rq->stop. The problem is that rq->stop.prio matches an RT prio and thus falsely assumes its a rt_sched_class task.

LKML-Reference: <new-submission>

---
 kernel/sched_rt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/sched_rt.c +1 -1
index c914ec7..ad62677 100644
@@ -625,7 +625,7 @@ static void update_curr_rt(struct rq *rq)
 	struct rt_rq *rt_rq = rt_rq_of_se(rt_se);
 	u64 delta_exec;
 
-	if (!task_has_rt_policy(curr))
+	if (curr->sched_class != &rt_sched_class)
 		return;
 
 	delta_exec = rq->clock_task - curr->se.exec_start;