Re: [PATCH][RFC]: mutex: adaptive spin

Ingo Molnar
2009-01-06T17:02:46Z

* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Tue, 6 Jan 2009, Linus Torvalds wrote:
> >
> > Right now, if some process deadlocks on a mutex, we get hung process,
> > but with a nice backtrace and hopefully other things (that don't need
> > that lock) still continue to work.
>
> Clarification: the "nice backtrace" we only get with something like
> sysrq-W, of course. We don't get a backtrace _automatically_, but with
> an otherwise live machine, there's a better chance that people do get
> wchan or other info. IOW, it's at least a fairly debuggable situation.

btw., the softlockup watchdog detects non-progressing uninterruptible
tasks (regardless of whether they locked up due to mutexes or any other
reason).

This does occasionally help in debugging deadlocks:

http://marc.info/?l=linux-mm&m=122889587725061&w=2

but it would indeed be also good to have the most common self-deadlock
case checked unconditionally in the mutex slowpath.

Ingo