lkml.org 
[lkml]   [2014]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [tip:locking/core] x86, locking/rwlocks: Enable qrwlocks on x86
From
Date
On Fri, 2014-06-06 at 05:20 -0700, tip-bot for Waiman Long wrote:
> Make x86 use the fair rwlock_t.
>
> Implement the custom queue_write_unlock() for best performance.

This landed in linux-next yesterday (ie, next-20140610).

> 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>
>[...]
> diff --git a/arch/x86/include/asm/qrwlock.h b/arch/x86/include/asm/qrwlock.h
> new file mode 100644
> index 0000000..70f46f0
> --- /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)

X86_OOSTORE was removed in v3.14, see commit 09df7c4c8097 ("x86: Remove
CONFIG_X86_OOSTORE"). So the first test can be removed here, as it will
always be true. Should I submit the trivial, but probably untested,
patch to do that or do you prefer to do that yourself?

> +#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 */

Thanks,


Paul Bolle



\
 
 \ /
  Last update: 2014-06-11 11:21    [W:0.080 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site