Commit-ID:  77177856e3bf39d435b3ae4bfd164ca3c8cd4577
Gitweb:     http://git.kernel.org/tip/77177856e3bf39d435b3ae4bfd164ca3c8cd4577
Author:     Thomas Gleixner <t...@linutronix.de>
AuthorDate: Fri, 7 Feb 2014 20:58:37 +0100
Committer:  Ingo Molnar <mi...@kernel.org>
CommitDate: Sat, 22 Feb 2014 18:07:36 +0100

sched: Init idle->on_rq in init_idle()

We stumbled in RT over a SMP bringup issue on ARM where the
idle->on_rq == 0 was causing try_to_wakeup() on the other cpu to run
into nada land.

After adding that idle->on_rq = 1; I was able to find the root cause
of the lockup: the idle task on the newly woken up cpu was fiddling
with a sleeping spinlock, which is a nono.

I kept the init of idle->on_rq to keep the state consistent and to
avoid another long lasting debug session.

As a side note, the whole debug mess could have been avoided if
might_sleep() would have yelled when called from the idle task. That's
fixed with patch 2/6 - and that one actually has a changelog :)

Signed-off-by: Thomas Gleixner <t...@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bige...@linutronix.de>
Signed-off-by: Peter Zijlstra <pet...@infradead.org>
Link: 
http://lkml.kernel.org/r/1391803122-4425-2-git-send-email-bige...@linutronix.de
Signed-off-by: Ingo Molnar <mi...@kernel.org>
---
 kernel/sched/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 49db434..06da865 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4443,6 +4443,7 @@ void init_idle(struct task_struct *idle, int cpu)
        rcu_read_unlock();
 
        rq->curr = rq->idle = idle;
+       idle->on_rq = 1;
 #if defined(CONFIG_SMP)
        idle->on_cpu = 1;
 #endif
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to