lkml.org 
[lkml]   [2016]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH tip/core/rcu 02/14] documentation: Fix control dependency and identical stores
On Thu, Feb 25, 2016 at 06:07:03AM -0800, Paul E. McKenney wrote:
> Still bad wording...
>
> It hasn't actually moved anything over the barrier(). It has instead
> moved both the barrier() and the WRITE_ONCE(b, p) to precede the "if
> (q)". Mathieu mentioned this over IRC yesterday, and I queue a change
> so that the paragraph now reads as follows:
>
> (*) If both legs of the "if" statement begin with identical stores to
> the same variable, then those stores must be ordered, either by
> preceding both of them with smp_mb() or by using smp_store_release()
> to carry out the stores. Please note that it is -not- sufficient
> to use barrier() at beginning of each leg of the "if" statement
> because, as shown by the example above, optimizing compilers can
> destroy the control dependency while respecting the letter of the
> barrier() law.
>
> Does hat help?

Maybe.. I still feel the compiler should not do this; but I'm having a
hard time explaining why.

\
 
 \ /
  Last update: 2016-02-25 16:21    [W:0.080 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site