[lkml]   [2014]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/6 v2] sched: Init idle->on_rq in init_idle()
On Tue, 11 Feb 2014, Peter Zijlstra wrote:

> On Tue, Feb 11, 2014 at 10:17:58AM +0100, Sebastian Andrzej Siewior wrote:
> > The init task is state TASK_RUNNING and on_irq should be set to 1. It won't
> ^^^ irq? :-)
> > be set by scheduler because the idle task is never woken up, it is always the
> > task we fall back to if there is no other task pending.
> But why? Who cares? I mean, its true.. but what problem does it solve.
> Why did Thomas write this patch.

I could slap myself for not writing a proper changelog right away. It
took me some time to figure out why it was added in the first place,
why it's not longer necessary and why I kept it.

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 :)



 \ /
  Last update: 2014-02-11 17:21    [W:0.074 / U:1.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site