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

From: Reshetova, Elena
Date: Tue Jan 29 2019 - 08:39:24 EST



> 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 __always_inline void refcount_dec(refcount_t *r)
> > > static __always_inline __must_check
> > > bool refcount_sub_and_test(unsigned int i, refcount_t *r)
> > > {
> > > - return GEN_BINARY_SUFFIXED_RMWcc(LOCK_PREFIX "subl",
> > > + bool ret = GEN_BINARY_SUFFIXED_RMWcc(LOCK_PREFIX "subl",
> > >
> REFCOUNT_CHECK_LT_ZERO,
> > > r-
> >refs.counter, e, "er", i, "cx");
> > > +
> > > + if (ret) {
> > > + smp_acquire__after_ctrl_dep();
> > > + return true;
> > > + }
> > > +
> > > + return false;
> >
> > There appears to be some white-space damage (here and in other places);
> > checkpatch.pl should point these and other style problems out.
>
> It's worse...
>
> patch: **** malformed patch at line 81: diff --git
> a/arch/x86/include/asm/refcount.h b/arch/x86/include/asm/refcount.h
>
> And yes, there's a lot of whitespace damage all around. Lots of trailing
> spaces too.


I am very sorry about this, smth is really wrong with my system, in addition to all
above, I haven't even received Andrea reply to my inbox, neither this patch itself.

I will fix all the whitespacing/trailing stuff and address this comment from Andrea:

"Mmh, this property (A-cumulativity) isn't really associated to ACQUIREs
in the LKMM; I'd suggest to simply remove the last sentence."

Anything else that needs fixing, content-wise?

Best Regards,
Elena.