Re: [PATCH] lightnvm: pblk: Add read memory barrier when reading from rb

2018-07-03 Thread Heiner Litz
Hi Matias, I think you may be right. I created some test benches and could produce the error I was expecting. My reasoning was based on the following: "This will not have the desired effect because there is no actual data dependency, but rather a control dependency that the CPU may short-circuit

Re: [PATCH] lightnvm: pblk: Add read memory barrier when reading from rb

2018-06-28 Thread Javier Gonzalez
> On 28 Jun 2018, at 09.59, Matias Bjørling wrote: > > On 06/28/2018 01:31 AM, Heiner Litz wrote: >> There is a control dependency between two disjoint variables (only read data >> if flags == WRITTEN). Because x86-TSO allows re-ordering of loads the >> control dependency can be violated. > >

Re: [PATCH] lightnvm: pblk: Add read memory barrier when reading from rb

2018-06-28 Thread Matias Bjørling
On 06/28/2018 01:31 AM, Heiner Litz wrote: There is a control dependency between two disjoint variables (only read data if flags == WRITTEN). Because x86-TSO allows re-ordering of loads the control dependency can be violated. I'm sorry, I do not see it :) Here is my understanding:

Re: [PATCH] lightnvm: pblk: Add read memory barrier when reading from rb

2018-06-22 Thread Matias Bjørling
On 06/21/2018 12:54 AM, Heiner Litz wrote: READ_ONCE does not imply a read memory barrier in the presence of control dependencies between two separate memory locations (flags and data). On x86 TSO, reading from the data page might be reordered before the flags read. See chapter CONTROL

Re: [PATCH] lightnvm: pblk: Add read memory barrier when reading from rb

2018-06-21 Thread Javier Gonzalez
> On 21 Jun 2018, at 00.54, Heiner Litz wrote: > > READ_ONCE does not imply a read memory barrier in the presence of control > dependencies between two separate memory locations (flags and data). On x86 > TSO, reading from the data page might be reordered before the flags read. > See chapter

[PATCH] lightnvm: pblk: Add read memory barrier when reading from rb

2018-06-20 Thread Heiner Litz
READ_ONCE does not imply a read memory barrier in the presence of control dependencies between two separate memory locations (flags and data). On x86 TSO, reading from the data page might be reordered before the flags read. See chapter CONTROL DEPENDENCIES in