]> err.no Git - linux-2.6/commit
[PATCH] s390: Increase spinlock retry code performance
authorChristian Ehrhardt <ehrhardt@de.ibm.com>
Fri, 10 Mar 2006 01:33:49 +0000 (17:33 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 10 Mar 2006 03:47:38 +0000 (19:47 -0800)
commit96567161de0ceed45cd2eb0e5380e3c797f5c0f4
treeeb1cf052c95b95052e281f9a0d33ea025ce39dc5
parent6a88231fc7da311e4da4ce2011d1a132c80c145a
[PATCH] s390: Increase spinlock retry code performance

Currently the code tries up to spin_retry times to grab a lock using the cs
instruction.  The cs instruction has exclusive access to a memory region
and therefore invalidates the appropiate cache line of all other cpus.  If
there is contention on a lock this leads to cache line trashing.  This can
be avoided if we first check wether a cs instruction is likely to succeed
before the instruction gets actually executed.

Signed-off-by: Christian Ehrhardt <ehrhardt@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/s390/lib/spinlock.c