Re: [bisected] system hang after boot

From: Peter Zijlstra
Date: Wed Nov 22 2017 - 15:22:30 EST


On Wed, Nov 22, 2017 at 06:26:59PM +0000, Will Deacon wrote:

> Now, I can't see what the break_lock is doing here other than causing
> problems. Is there a good reason for it, or can you just try removing it
> altogether? Patch below.

The main use is spin_is_contended(), which in turn ends up used in
__cond_resched_lock() through spin_needbreak().

This allows better lock wait times for PREEMPT kernels on platforms
where the lock implementation itself cannot provide 'contended' state.

In that capacity the write-write race shouldn't be a problem though.

That said, I'd not be horribly sad to see this go, I've always found it
to be quite the ugly hack and taking it out should provide some
incentive for better lock implementations for the archs relying on this.