Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1370610

Re: [RFC][PATCH 3/3] locking,arm64: Introduce cmpwait()

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH 3/3] locking,arm64: Introduce cmpwait()
Date 2016-04-04 15:20 +0200
Message-ID <rkcAb-3vK-33@gated-at.bofh.it> (permalink)
References <rkbXs-31q-9@gated-at.bofh.it> <rkbXs-31q-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Apr 04, 2016 at 02:22:53PM +0200, Peter Zijlstra wrote:
> +#define __CMPWAIT_GEN(w, sz, name)					\

 +static inline  \

> +void __cmpwait_case_##name(volatile void *ptr, unsigned long val)	\
> +{									\
> +	unsigned long tmp;						\
> +									\
> +	asm volatile(							\
> +	"	ldxr" #sz "\t%" #w "[tmp], %[v]\n"			\
> +	"	eor	%" #w "[tmp], %" #w "[tmp], %" #w "[val]\n"	\
> +	"	cbnz	%" #w "[tmp], 1f\n"				\
> +	"	wfe\n"							\
> +	"1:"								\
> +	: [tmp] "=&r" (tmp), [val] "=&r" (val),				\
> +	  [v] "+Q" (*(unsigned long *)ptr));				\

And this probably wants a "memory" clobber to force reload values after
this returns.

> +}

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC][PATCH 3/3] locking,arm64: Introduce cmpwait() Peter Zijlstra <peterz@infradead.org> - 2016-04-04 14:40 +0200
  Re: [RFC][PATCH 3/3] locking,arm64: Introduce cmpwait() Peter Zijlstra <peterz@infradead.org> - 2016-04-04 15:20 +0200
  Re: [RFC][PATCH 3/3] locking,arm64: Introduce cmpwait() Will Deacon <will.deacon@arm.com> - 2016-04-12 19:00 +0200
    Re: [RFC][PATCH 3/3] locking,arm64: Introduce cmpwait() Peter Zijlstra <peterz@infradead.org> - 2016-04-13 15:00 +0200

csiph-web