Re: [PATCH 1/7] rcu: Create rcu_sync infrastructure

2015-07-15 Thread Paul E. McKenney
On Wed, Jul 15, 2015 at 09:08:15PM +0200, Oleg Nesterov wrote: > On 07/15, Paul E. McKenney wrote: > > > > On Wed, Jul 15, 2015 at 08:15:11PM +0200, Peter Zijlstra wrote: > > > > > > No, it makes the read-side primitive contain an unconditional memory > > > barrier, that forgoes the entire point. >

Re: [PATCH 1/7] rcu: Create rcu_sync infrastructure

2015-07-15 Thread Oleg Nesterov
On 07/15, Paul E. McKenney wrote: > > On Wed, Jul 15, 2015 at 08:15:11PM +0200, Peter Zijlstra wrote: > > > > No, it makes the read-side primitive contain an unconditional memory > > barrier, that forgoes the entire point. > > > > The writers are stupidly expensive already for they need global > >

Re: [PATCH 1/7] rcu: Create rcu_sync infrastructure

2015-07-15 Thread Oleg Nesterov
On 07/15, Paul E. McKenney wrote: > > On Sun, Jul 12, 2015 at 01:35:48AM +0200, Oleg Nesterov wrote: > > It is functionally equivalent to > > > > struct rcu_sync_struct { > > atomic_t counter; > > }; > > > > static inline bool rcu_sync_is_idle(struct rcu_sync

Re: [PATCH 1/7] rcu: Create rcu_sync infrastructure

2015-07-15 Thread Paul E. McKenney
On Wed, Jul 15, 2015 at 08:15:11PM +0200, Peter Zijlstra wrote: > On Wed, Jul 15, 2015 at 11:05:46AM -0700, Paul E. McKenney wrote: > > On Sun, Jul 12, 2015 at 01:35:48AM +0200, Oleg Nesterov wrote: > > > It is functionally equivalent to > > > > > > struct rcu_sync_struct { > > >

Re: [PATCH 1/7] rcu: Create rcu_sync infrastructure

2015-07-15 Thread Peter Zijlstra
On Wed, Jul 15, 2015 at 11:05:46AM -0700, Paul E. McKenney wrote: > On Sun, Jul 12, 2015 at 01:35:48AM +0200, Oleg Nesterov wrote: > > It is functionally equivalent to > > > > struct rcu_sync_struct { > > atomic_t counter; > > }; > > > > static inline bool

Re: [PATCH 1/7] rcu: Create rcu_sync infrastructure

2015-07-15 Thread Paul E. McKenney
On Sun, Jul 12, 2015 at 01:35:48AM +0200, Oleg Nesterov wrote: > It is functionally equivalent to > > struct rcu_sync_struct { > atomic_t counter; > }; > > static inline bool rcu_sync_is_idle(struct rcu_sync_struct *rss) > { If you add an smp_mb()

[PATCH 1/7] rcu: Create rcu_sync infrastructure

2015-07-11 Thread Oleg Nesterov
It is functionally equivalent to struct rcu_sync_struct { atomic_t counter; }; static inline bool rcu_sync_is_idle(struct rcu_sync_struct *rss) { return atomic_read(&rss->counter) == 0; } static inline void rcu_sync_