Re: [PATCH] refcount_t: add ACQUIRE ordering on success for dec(sub)_and_test variants

2019-01-30 Thread Peter Zijlstra
On Wed, Jan 30, 2019 at 01:31:31PM +0100, Andrea Parri wrote: > On Wed, Jan 30, 2019 at 01:18:51PM +0200, Elena Reshetova wrote: > > This adds an smp_acquire__after_ctrl_dep() barrier on successful > > decrease of refcounter value from 1 to 0 for refcount_dec(sub)_and_test > > variants and therefor

Re: [PATCH] refcount_t: add ACQUIRE ordering on success for dec(sub)_and_test variants

2019-01-30 Thread Andrea Parri
On Wed, Jan 30, 2019 at 01:18:51PM +0200, Elena Reshetova wrote: > This adds an smp_acquire__after_ctrl_dep() barrier on successful > decrease of refcounter value from 1 to 0 for refcount_dec(sub)_and_test > variants and therefore gives stronger memory ordering guarantees than > prior versions of t

[PATCH] refcount_t: add ACQUIRE ordering on success for dec(sub)_and_test variants

2019-01-30 Thread Elena Reshetova
This adds an smp_acquire__after_ctrl_dep() barrier on successful decrease of refcounter value from 1 to 0 for refcount_dec(sub)_and_test variants and therefore gives stronger memory ordering guarantees than prior versions of these functions. Co-developed-by: Peter Zijlstra (Intel) Signed-off-by:

Re: [PATCH] refcount_t: add ACQUIRE ordering on success for dec(sub)_and_test variants

2019-01-30 Thread Dmitry Vyukov
On Wed, Jan 30, 2019 at 11:19 AM Reshetova, Elena wrote: > > > So, you are saying that ACQUIRE does not guarantee that "po-later stores > > > on the same CPU and all propagated stores from other CPUs > > > must propagate to all other CPUs after the acquire operation "? > > > I was reading about a

RE: [PATCH] refcount_t: add ACQUIRE ordering on success for dec(sub)_and_test variants

2019-01-30 Thread Reshetova, Elena
> So, you are saying that ACQUIRE does not guarantee that "po-later stores > > on the same CPU and all propagated stores from other CPUs > > must propagate to all other CPUs after the acquire operation "? > > I was reading about acquire before posting this and trying to understand, > > and this wa

Re: [PATCH] refcount_t: add ACQUIRE ordering on success for dec(sub)_and_test variants

2019-01-29 Thread Andrea Parri
> So, you are saying that ACQUIRE does not guarantee that "po-later stores > on the same CPU and all propagated stores from other CPUs > must propagate to all other CPUs after the acquire operation "? > I was reading about acquire before posting this and trying to understand, > and this was my con

RE: [PATCH] refcount_t: add ACQUIRE ordering on success for dec(sub)_and_test variants

2019-01-29 Thread Reshetova, Elena
> On Mon, Jan 28, 2019 at 1:10 PM Elena Reshetova > wrote: > > > > This adds an smp_acquire__after_ctrl_dep() barrier on successful > > decrease of refcounter value from 1 to 0 for refcount_dec(sub)_and_test > > variants and therefore gives stronger memory ordering guarantees than > > prior versi

Re: [PATCH] refcount_t: add ACQUIRE ordering on success for dec(sub)_and_test variants

2019-01-29 Thread Dmitry Vyukov
On Mon, Jan 28, 2019 at 1:10 PM Elena Reshetova wrote: > > This adds an smp_acquire__after_ctrl_dep() barrier on successful > decrease of refcounter value from 1 to 0 for refcount_dec(sub)_and_test > variants and therefore gives stronger memory ordering guarantees than > prior versions of these fu

RE: [PATCH] refcount_t: add ACQUIRE ordering on success for dec(sub)_and_test variants

2019-01-29 Thread Reshetova, Elena
> On Mon, Jan 28, 2019 at 03:29:10PM +0100, Andrea Parri wrote: > > > > diff --git a/arch/x86/include/asm/refcount.h > > > b/arch/x86/include/asm/refcount.h > > > index dbaed55..ab8f584 100644 > > > --- a/arch/x86/include/asm/refcount.h > > > +++ b/arch/x86/include/asm/refcount.h > > > @@ -67,1

Re: [PATCH] refcount_t: add ACQUIRE ordering on success for dec(sub)_and_test variants

2019-01-29 Thread Peter Zijlstra
On Mon, Jan 28, 2019 at 03:29:10PM +0100, Andrea Parri wrote: > > diff --git a/arch/x86/include/asm/refcount.h > > b/arch/x86/include/asm/refcount.h > > index dbaed55..ab8f584 100644 > > --- a/arch/x86/include/asm/refcount.h > > +++ b/arch/x86/include/asm/refcount.h > > @@ -67,16 +67,29 @@ static

Re: [PATCH] refcount_t: add ACQUIRE ordering on success for dec(sub)_and_test variants

2019-01-28 Thread Andrea Parri
On Mon, Jan 28, 2019 at 02:09:37PM +0200, Elena Reshetova wrote: > This adds an smp_acquire__after_ctrl_dep() barrier on successful > decrease of refcounter value from 1 to 0 for refcount_dec(sub)_and_test > variants and therefore gives stronger memory ordering guarantees than > prior versions of t

[PATCH] refcount_t: add ACQUIRE ordering on success for dec(sub)_and_test variants

2019-01-28 Thread Elena Reshetova
This adds an smp_acquire__after_ctrl_dep() barrier on successful decrease of refcounter value from 1 to 0 for refcount_dec(sub)_and_test variants and therefore gives stronger memory ordering guarantees than prior versions of these functions. Co-Developed-by: Peter Zijlstra (Intel) Signed-off-by: