Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-07 Thread Paul E. McKenney
On Mon, Jan 07, 2019 at 02:13:29PM -0500, Michael S. Tsirkin wrote: > On Mon, Jan 07, 2019 at 11:02:36AM -0800, Paul E. McKenney wrote: > > On Mon, Jan 07, 2019 at 08:36:36AM -0500, Michael S. Tsirkin wrote: > > > On Mon, Jan 07, 2019 at 10:46:10AM +0100, Peter Zijlstra wrote: > > > > On Sun, Jan 0

Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-07 Thread Michael S. Tsirkin
On Mon, Jan 07, 2019 at 11:02:36AM -0800, Paul E. McKenney wrote: > On Mon, Jan 07, 2019 at 08:36:36AM -0500, Michael S. Tsirkin wrote: > > On Mon, Jan 07, 2019 at 10:46:10AM +0100, Peter Zijlstra wrote: > > > On Sun, Jan 06, 2019 at 11:23:07PM -0500, Michael S. Tsirkin wrote: > > > > On Mon, Jan 0

Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-07 Thread Paul E. McKenney
On Mon, Jan 07, 2019 at 08:36:36AM -0500, Michael S. Tsirkin wrote: > On Mon, Jan 07, 2019 at 10:46:10AM +0100, Peter Zijlstra wrote: > > On Sun, Jan 06, 2019 at 11:23:07PM -0500, Michael S. Tsirkin wrote: > > > On Mon, Jan 07, 2019 at 11:58:23AM +0800, Jason Wang wrote: > > > > On 2019/1/3 上午4:57,

Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-07 Thread Michael S. Tsirkin
On Mon, Jan 07, 2019 at 04:54:23PM +0100, Peter Zijlstra wrote: > On Mon, Jan 07, 2019 at 08:36:36AM -0500, Michael S. Tsirkin wrote: > > On Mon, Jan 07, 2019 at 10:46:10AM +0100, Peter Zijlstra wrote: > > > > How about naming the thing: dependent_ptr() ? That is without any (r)mb > > > implicatio

Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-07 Thread Peter Zijlstra
On Mon, Jan 07, 2019 at 08:36:36AM -0500, Michael S. Tsirkin wrote: > On Mon, Jan 07, 2019 at 10:46:10AM +0100, Peter Zijlstra wrote: > > How about naming the thing: dependent_ptr() ? That is without any (r)mb > > implications at all. The address dependency is strictly weaker than an > > rmb in th

Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-07 Thread Michael S. Tsirkin
On Mon, Jan 07, 2019 at 10:46:10AM +0100, Peter Zijlstra wrote: > On Sun, Jan 06, 2019 at 11:23:07PM -0500, Michael S. Tsirkin wrote: > > On Mon, Jan 07, 2019 at 11:58:23AM +0800, Jason Wang wrote: > > > On 2019/1/3 上午4:57, Michael S. Tsirkin wrote: > > > > > +#if defined(COMPILER_HAS_OPTIMIZER_HI

Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-07 Thread Peter Zijlstra
On Sun, Jan 06, 2019 at 11:23:07PM -0500, Michael S. Tsirkin wrote: > On Mon, Jan 07, 2019 at 11:58:23AM +0800, Jason Wang wrote: > > On 2019/1/3 上午4:57, Michael S. Tsirkin wrote: > > > +#if defined(COMPILER_HAS_OPTIMIZER_HIDE_VAR) && \ > > > + !defined(ARCH_NEEDS_READ_BARRIER_DEPENDS) > > > + > >

Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-06 Thread Jason Wang
On 2019/1/7 下午12:23, Michael S. Tsirkin wrote: On Mon, Jan 07, 2019 at 11:58:23AM +0800, Jason Wang wrote: On 2019/1/3 上午4:57, Michael S. Tsirkin wrote: It's not uncommon to have two access two unrelated memory locations in a specific order. At the moment one has to use a memory barrier for

Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-06 Thread Michael S. Tsirkin
On Mon, Jan 07, 2019 at 11:58:23AM +0800, Jason Wang wrote: > > On 2019/1/3 上午4:57, Michael S. Tsirkin wrote: > > It's not uncommon to have two access two unrelated memory locations in a > > specific order. At the moment one has to use a memory barrier for this. > > > > However, if the first acc

Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-06 Thread Jason Wang
On 2019/1/3 上午4:57, Michael S. Tsirkin wrote: It's not uncommon to have two access two unrelated memory locations in a specific order. At the moment one has to use a memory barrier for this. However, if the first access was a read and the second used an address depending on the first one we w

Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-02 Thread Michael S. Tsirkin
On Wed, Jan 02, 2019 at 01:00:24PM -0800, Matthew Wilcox wrote: > On Wed, Jan 02, 2019 at 03:57:58PM -0500, Michael S. Tsirkin wrote: > > @@ -875,6 +893,8 @@ to the CPU containing it. See the section on > > "Multicopy atomicity" > > for more information. > > > > > > + > > + > > In summary:

Re: [PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-02 Thread Matthew Wilcox
On Wed, Jan 02, 2019 at 03:57:58PM -0500, Michael S. Tsirkin wrote: > @@ -875,6 +893,8 @@ to the CPU containing it. See the section on "Multicopy > atomicity" > for more information. > > > + > + > In summary: > >(*) Control dependencies can order prior loads against later stores. Was

[PATCH RFC 3/4] barriers: convert a control to a data dependency

2019-01-02 Thread Michael S. Tsirkin
It's not uncommon to have two access two unrelated memory locations in a specific order. At the moment one has to use a memory barrier for this. However, if the first access was a read and the second used an address depending on the first one we would have a data dependency and no barrier would b