Re: [tip:locking/core] x86, locking/rwlocks: Enable qrwlocks on x86

From: Paul Bolle
Date: Wed Jun 11 2014 - 04:14:24 EST


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@xxxxxx>
> [peterz: near complete rewrite]
> Signed-off-by: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Dave Jones <davej@xxxxxxxxxx>
> Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Cc: Oleg Nesterov <oleg@xxxxxxxxxx>
> Cc: Raghavendra K T <raghavendra.kt@xxxxxxxxxxxxxxxxxx>
> Cc: "Paul E.McKenney" <paulmck@xxxxxxxxxxxxxxxxxx>
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Cc: x86@xxxxxxxxxx
> Link: http://lkml.kernel.org/n/tip-r1xuzmdysvuhl3h86n5fbxi7@xxxxxxxxxxxxxx
> Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
>[...]
> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/