diff options
author | Waiman Long <Waiman.Long@hp.com> | 2014-02-03 13:18:57 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-06-06 07:58:29 +0200 |
commit | bd01ec1a13f9a327950c8e3080096446c7804753 (patch) | |
tree | 5af212f946ee023fdbadc9b14ff9e2a1431a0c72 /arch/x86/include/asm/qrwlock.h | |
parent | 70af2f8a4f48d6cebdf92d533d3aef37853ce6de (diff) | |
download | linux-stable-bd01ec1a13f9a327950c8e3080096446c7804753.tar.gz linux-stable-bd01ec1a13f9a327950c8e3080096446c7804753.tar.bz2 linux-stable-bd01ec1a13f9a327950c8e3080096446c7804753.zip |
x86, locking/rwlocks: Enable qrwlocks on x86
Make x86 use the fair rwlock_t.
Implement the custom queue_write_unlock() for best performance.
Signed-off-by: Waiman Long <Waiman.Long@hp.com>
[peterz: near complete rewrite]
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Dave Jones <davej@redhat.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Cc: "Paul E.McKenney" <paulmck@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org
Cc: x86@kernel.org
Link: http://lkml.kernel.org/n/tip-r1xuzmdysvuhl3h86n5fbxi7@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/include/asm/qrwlock.h')
-rw-r--r-- | arch/x86/include/asm/qrwlock.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/x86/include/asm/qrwlock.h b/arch/x86/include/asm/qrwlock.h new file mode 100644 index 000000000000..70f46f07f94e --- /dev/null +++ b/arch/x86/include/asm/qrwlock.h @@ -0,0 +1,17 @@ +#ifndef _ASM_X86_QRWLOCK_H +#define _ASM_X86_QRWLOCK_H + +#include <asm-generic/qrwlock_types.h> + +#if !defined(CONFIG_X86_OOSTORE) && !defined(CONFIG_X86_PPRO_FENCE) +#define queue_write_unlock queue_write_unlock +static inline void queue_write_unlock(struct qrwlock *lock) +{ + barrier(); + ACCESS_ONCE(*(u8 *)&lock->cnts) = 0; +} +#endif + +#include <asm-generic/qrwlock.h> + +#endif /* _ASM_X86_QRWLOCK_H */ |