Re: contention on long-held spinlock

From: Andi Kleen
Date: Fri Aug 19 2011 - 19:30:25 EST


Ortwin GlÃck <odi@xxxxxx> writes:
>
> I wonder if spinlocks could be made aware of such a situation and
> relax. Something like if spinning for more than 1000 times, perform a
> simple backoff and sleep. A spinlock should never spin busy for
> several seconds, right?

Spining for several seconds is always a bug. There's no way to make
this work. Please post backtraces (e.g. from perf record -g ; perf
report) and cc the driver maintainer, so that they can fix their
buggy code.

-Andi


--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only
--
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/