Re: [PATCH v3 tip/core/rcu 3/9] rcu: Add synchronous grace-period waiting for RCU-tasks

Oleg Nesterov
2014-08-02T14:50:03Z

On 08/01, Paul E. McKenney wrote:
>
> On Fri, Aug 01, 2014 at 11:32:51AM -0700, Paul E. McKenney wrote:
> > On Fri, Aug 01, 2014 at 05:09:26PM +0200, Oleg Nesterov wrote:
> > > On 07/31, Paul E. McKenney wrote:
> > > >
> > > > +void synchronize_rcu_tasks(void)
> > > > +{
> > > > + /* Complain if the scheduler has not started. */
> > > > + rcu_lockdep_assert(!rcu_scheduler_active,
> > > > + "synchronize_rcu_tasks called too soon");
> > > > +
> > > > + /* Wait for the grace period. */
> > > > + wait_rcu_gp(call_rcu_tasks);
> > > > +}
> > >
> > > Btw, what about CONFIG_PREEMPT=n ?
> > >
> > > I mean, can't synchronize_rcu_tasks() be synchronize_sched() in this
> > > case?
> >
> > Excellent point, indeed it can!
> >
> > And if I do it right, it will make CONFIG_TASKS_RCU=y safe for kernel
> > tinification. ;-)
>
> Unless, that is, we need to wait for trampolines in the idle loop...
>
> Sounds like a question for Steven. ;-)

Sure, but the full blown synchronize_rcu_tasks() can't handle the idle threads
anyway. An idle thread can not be deactivated and for_each_process() can't see
it anyway.

Oleg.