Re: [PATCH 1/1] doc: Update control-dependencies section of memory-barriers.txt

2017-04-07 Thread Paul E. McKenney
On Fri, Apr 07, 2017 at 10:15:07AM +0100, Will Deacon wrote: > On Fri, Apr 07, 2017 at 02:37:36PM +0800, pierre Kuo wrote: > > for below example, if MAX is defined to be 1, then the compiler knows (Q > > % MAX) is equal to zero. > > so compiler will transform the "else" part of code. > > > > q

Re: [PATCH 1/1] doc: Update control-dependencies section of memory-barriers.txt

2017-04-07 Thread Will Deacon
On Fri, Apr 07, 2017 at 02:37:36PM +0800, pierre Kuo wrote: > for below example, if MAX is defined to be 1, then the compiler knows (Q > % MAX) is equal to zero. > so compiler will transform the "else" part of code. > > q = READ_ONCE(a); > if (q % MAX) { > WRITE_ONCE(b, 1

[PATCH 1/1] doc: Update control-dependencies section of memory-barriers.txt

2017-04-06 Thread pierre Kuo
for below example, if MAX is defined to be 1, then the compiler knows (Q % MAX) is equal to zero. so compiler will transform the "else" part of code. q = READ_ONCE(a); if (q % MAX) { WRITE_ONCE(b, 1); do_something(); } else {