Re: [BUG] kernel freezes with latest tree
From: Ingo Molnar
Date: Wed Jan 11 2012 - 10:57:15 EST
* Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Wed, 2012-01-11 at 10:04 +0100, Peter Zijlstra wrote:
> > Maybe adding a few more NEED_BREAK bits
> > and making it a counter and overflowing it into ABORT might be good.
> >
> >
>
> I could reproduce and confirm something like the below makes
> the hang go-away. I haven't managed to fully understand why
> we're stuck though because we do release the runqueue locks
> and re-enable IRQs on this lock-break.
Well, what happens if every CPU runs load_balance() and we keep
triggering:
if (loops++ > sysctl_sched_nr_migrate) {
*lb_flags |= LBF_NEED_BREAK;
break;
}
in this case load_balance() will do the retry:
if (lb_flags & LBF_NEED_BREAK) {
lb_flags &= ~LBF_NEED_BREAK;
goto redo;
}
but the retry starts the loop again:
list_for_each_entry_safe(p, n, &busiest_cfs_rq->tasks, se.group_node) {
so nobody is able to make progress: livelock/lockup.
( This also explains why i was unable to see this in my
randomized testing: my tests never extreme enough to trigger
the sysctl_sched_nr_migrate threshold. )
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/