Re: [PATCH v4] locking/mutex: Prevent lock starvation when spinning is disabled

Linus Torvalds
2016-08-19T19:45:30Z

On Fri, Aug 19, 2016 at 12:33 PM, Peter Zijlstra <peterz@infradead.org> wrote:
>
> That seems more messy to me..

Can't we just say that we always spin? Are there any really valid
cases where spinning isn't ok?

We've historically disabled spinning when mutex debugging is enabled,
but since the spinning is limited anyway, couldn't we just spin even
with debugging enabled?

I hate how these patches are trying to solve a problem that doesn't
even happen under normal circumstances, and add special-case code for
something that is already a special-case condition. So rather than
adding even more special cases, could we look at _removing_ the
special cases that cause problems instead?

Linus