[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <926765904.37296.1420822388866.JavaMail.zimbra@efficios.com>
Date: Fri, 9 Jan 2015 16:53:08 +0000 (UTC)
From: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To: paulmck@...ux.vnet.ibm.com
Cc: Peter Zijlstra <peterz@...radead.org>,
Davidlohr Bueso <dave@...olabs.net>,
linux-kernel@...r.kernel.org, mingo@...nel.org,
laijs@...fujitsu.com, dipankar@...ibm.com,
akpm@...ux-foundation.org, josh@...htriplett.org,
tglx@...utronix.de, rostedt@...dmis.org, dhowells@...hat.com,
edumazet@...gle.com, dvhart@...ux.intel.com, fweisbec@...il.com,
oleg@...hat.com, bobby prani <bobby.prani@...il.com>,
borntraeger@...ibm.com
Subject: Re: [PATCH tip/core/rcu 01/14] rcu: Protect rcu_boost() lockless
accesses with ACCESS_ONCE()
----- Original Message -----
> From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
> To: "Peter Zijlstra" <peterz@...radead.org>
> Cc: "Davidlohr Bueso" <dave@...olabs.net>, linux-kernel@...r.kernel.org, mingo@...nel.org, laijs@...fujitsu.com,
> dipankar@...ibm.com, akpm@...ux-foundation.org, "mathieu desnoyers" <mathieu.desnoyers@...icios.com>,
> josh@...htriplett.org, tglx@...utronix.de, rostedt@...dmis.org, dhowells@...hat.com, edumazet@...gle.com,
> dvhart@...ux.intel.com, fweisbec@...il.com, oleg@...hat.com, "bobby prani" <bobby.prani@...il.com>,
> borntraeger@...ibm.com
> Sent: Friday, January 9, 2015 9:07:34 AM
> Subject: Re: [PATCH tip/core/rcu 01/14] rcu: Protect rcu_boost() lockless accesses with ACCESS_ONCE()
>
> On Fri, Jan 09, 2015 at 02:56:14PM +0100, Peter Zijlstra wrote:
> > On Fri, Jan 09, 2015 at 05:49:54AM -0800, Paul E. McKenney wrote:
> > > > That reminds me, I think the new conversion for stores will most likely
> > > > introduce silly arg bugs:
> > > >
> > > > - ACCESS_ONCE(a) = b;
> > > > + ASSIGN_ONCE(b, a);
> > >
> > > I was planning to do mine by hand for this sort of reason.
> > >
> > > Or are you thinking of something more subtle than the case where
> > > "b" is an unparenthesized comma-separated expression?
> >
> > I think he's revering to the wrong way around-ness of the thing.
> >
> > Its a bit of a mixed bag on assignments, but for instance
> > rcu_assign_pointer() takes them the right way around, as does
> > atomic_set().
> >
> > So yes, I think the ASSIGN_ONCE() thing got the arguments the wrong way
> > around.
>
> Ah, yes, I had forgotten about this point.
>
> > We could maybe still change it, before its in too long ?
>
> I would be in favor. Any objections? ;-)
Agreed. The target argument should be the first parameter. Also,
do you plan to make ASSIGN_ONCE() evaluate to something or void ?
In userland liburcu CMM_STORE_SHARED(), which evaluates to the value
used as input, we hit warnings with static checkers due to unused
value, which is unfortunate. Not sure if the checkers should be
thought better, or if evaluating to void is the right approach there.
Thanks,
Mathieu
>
> Thanx, Paul
>
>
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists