Re: [RFC] introduce synchronize_sched_{enter,exit}()

2013-10-03 Thread Peter Zijlstra
On Thu, Oct 03, 2013 at 09:04:59AM +0200, Ingo Molnar wrote: > > * Peter Zijlstra wrote: > > > > > Fully agreed! :-) haha.. never realized I send that email completely empty. It was supposed to contain the patch I later send as 2/3. -- To unsubscribe from this list: send the line "unsubscribe

Re: [RFC] introduce synchronize_sched_{enter,exit}()

2013-10-03 Thread Ingo Molnar
* Peter Zijlstra wrote: > Fully agreed! :-) Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.o

Re: [RFC] introduce synchronize_sched_{enter,exit}()

2013-10-02 Thread Peter Zijlstra
-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [RFC] introduce synchronize_sched_{enter,exit}()

2013-09-30 Thread Oleg Nesterov
On 09/30, Peter Zijlstra wrote: > > On Mon, Sep 30, 2013 at 04:24:00PM +0200, Peter Zijlstra wrote: > > For that we'd have to decrement xxx->gp_count from cb_rcu_func(), > > wouldn't we? > > > > Without that there's no guarantee the fast path readers will have a MB > > to observe the write critical

Re: [RFC] introduce synchronize_sched_{enter,exit}()

2013-09-30 Thread Oleg Nesterov
On 09/30, Peter Zijlstra wrote: > > On Sun, Sep 29, 2013 at 08:36:34PM +0200, Oleg Nesterov wrote: > > Why? Say, percpu_rw_semaphore, or upcoming changes in get_online_cpus(), > > (Peter, I think they should be unified anyway, but lets ignore this for > > now). > > If you think the percpu_rwsem use

Re: [RFC] introduce synchronize_sched_{enter,exit}()

2013-09-30 Thread Peter Zijlstra
On Mon, Sep 30, 2013 at 04:24:00PM +0200, Peter Zijlstra wrote: > For that we'd have to decrement xxx->gp_count from cb_rcu_func(), > wouldn't we? > > Without that there's no guarantee the fast path readers will have a MB > to observe the write critical section, unless I'm completely missing > som

Re: [RFC] introduce synchronize_sched_{enter,exit}()

2013-09-30 Thread Peter Zijlstra
On Mon, Sep 30, 2013 at 02:59:42PM +0200, Peter Zijlstra wrote: > > > > static void cb_rcu_func(struct rcu_head *rcu) > > { > > struct xxx_struct *xxx = container_of(rcu, struct xxx_struct, cb_head); > > long flags; > > > > BUG_ON(xxx->gp_state != GP_PASSED); > > BUG_ON(xxx->cb_s

Re: [RFC] introduce synchronize_sched_{enter,exit}()

2013-09-30 Thread Oleg Nesterov
On 09/29, Steven Rostedt wrote: > > On Sun, 29 Sep 2013 20:36:34 +0200 > Oleg Nesterov wrote: > > > > Why? Say, percpu_rw_semaphore, or upcoming changes in get_online_cpus(), > > (Peter, I think they should be unified anyway, but lets ignore this for > > now). Or freeze_super() (which currently lo

Re: [RFC] introduce synchronize_sched_{enter,exit}()

2013-09-30 Thread Peter Zijlstra
On Sun, Sep 29, 2013 at 08:36:34PM +0200, Oleg Nesterov wrote: > Why? Say, percpu_rw_semaphore, or upcoming changes in get_online_cpus(), > (Peter, I think they should be unified anyway, but lets ignore this for > now). If you think the percpu_rwsem users can benefit sure.. So far its good I didn

Re: [RFC] introduce synchronize_sched_{enter,exit}()

2013-09-30 Thread Oleg Nesterov
On 09/29, Paul E. McKenney wrote: > > On Sun, Sep 29, 2013 at 08:36:34PM +0200, Oleg Nesterov wrote: > > > > struct xxx_struct { > > atomic_t counter; > > }; > > > > static inline bool xxx_is_idle(struct xxx_struct *xxx) > > { > > return atomic_read(&xxx->cou

Re: [RFC] introduce synchronize_sched_{enter,exit}()

2013-09-29 Thread Steven Rostedt
On Sun, 29 Sep 2013 20:36:34 +0200 Oleg Nesterov wrote: > Why? Say, percpu_rw_semaphore, or upcoming changes in get_online_cpus(), > (Peter, I think they should be unified anyway, but lets ignore this for > now). Or freeze_super() (which currently looks buggy), perhaps something > else. This pa

Re: [RFC] introduce synchronize_sched_{enter,exit}()

2013-09-29 Thread Paul E. McKenney
On Sun, Sep 29, 2013 at 08:36:34PM +0200, Oleg Nesterov wrote: > Hello. > > Paul, Peter, et al, could you review the code below? > > I am not sending the patch, I think it is simpler to read the code > inline (just in case, I didn't try to compile it yet). > > It is functionally equivalent to >

[RFC] introduce synchronize_sched_{enter,exit}()

2013-09-29 Thread Oleg Nesterov
Hello. Paul, Peter, et al, could you review the code below? I am not sending the patch, I think it is simpler to read the code inline (just in case, I didn't try to compile it yet). It is functionally equivalent to struct xxx_struct { atomic_t counter; };