]> git.baikalelectronics.ru Git - kernel.git/commit
bit_spinlock: don't play preemption games inside the busy loop
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Apr 2011 01:10:58 +0000 (18:10 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Apr 2011 01:10:58 +0000 (18:10 -0700)
commit95441485c9a0ccc6d93fa188de8d1054ef5d3bbe
tree40d8d017d9631ecefae76eb09e1bbecc23e17452
parent1f8bd30da6458ec0d3a151b7eaa737238e04a2a1
bit_spinlock: don't play preemption games inside the busy loop

When we are waiting for the bit-lock to be released, and are looping
over the 'cpu_relax()' should not be doing anything else - otherwise we
miss the point of trying to do the whole 'cpu_relax()'.

Do the preemption enable/disable around the loop, rather than inside of
it.

Noticed when I was looking at the code generation for the dcache
__d_drop usage, and the code just looked very odd.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/bit_spinlock.h