ARCv2: spinlock/rwlock: Reset retry delay when starting a new spin-wait cycle
authorVineet Gupta <vgupta@synopsys.com>
Tue, 21 Jul 2015 15:46:53 +0000 (18:46 +0300)
committerVineet Gupta <vgupta@synopsys.com>
Tue, 4 Aug 2015 03:56:35 +0000 (09:26 +0530)
commitb89aa12c177477e34caa722818536fb5d0bffd76
tree66f2d999f9f0a140790fc62f50504e2ce659bd01
parente78fdfef84be13a5c2b8276e12203cdf24778596
ARCv2: spinlock/rwlock: Reset retry delay when starting a new spin-wait cycle

The previous commit for delayed retry of SCOND needs some fine tuning
for spin locks.

The backoff from delayed retry in conjunction with spin looping of lock
itself can potentially cause the delay counter to reach high values.
So to provide fairness to any lock operation, after a lock "seems"
available (i.e. just before first SCOND try0, reset the delay counter
back to starting value of 1

Essentially reset delay to 1 for a new spin-wait-loop-acquire cycle.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/include/asm/spinlock.h