diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2014-05-15 11:00:44 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2014-05-20 08:58:53 +0200 |
commit | bae8f567344a7cb6a23ca6e13096ba785c69eb42 (patch) | |
tree | a0d91d9abf8405646ffbd5201d8c1b7f2627563c /arch/powerpc | |
parent | 2bf29df7460f4038f84ac5dea3cbe582d6d4af82 (diff) | |
download | linux-bae8f567344a7cb6a23ca6e13096ba785c69eb42.tar.gz linux-bae8f567344a7cb6a23ca6e13096ba785c69eb42.tar.bz2 linux-bae8f567344a7cb6a23ca6e13096ba785c69eb42.zip |
s390/spinlock,rwlock: always to a load-and-test first
In case a lock is contended it is better to do a load-and-test first
before trying to get the lock with compare-and-swap. This helps to avoid
unnecessary cache invalidations of the cacheline for the lock if the
CPU has to wait for the lock. For an uncontended lock doing the
compare-and-swap directly is a bit better, if the CPU does not have the
cacheline in its cache yet the compare-and-swap will get it read-write
immediately while a load-and-test would get it read-only first.
Always to the load-and-test first to avoid the cacheline invalidations
for the contended case outweight the potential read-only to read-write
cacheline upgrade for the uncontended case.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/powerpc')
0 files changed, 0 insertions, 0 deletions