Re: [PATCH tip/core/rcu 07/23] rcu: Provide OOM handler to motivatelazy RCU callbacks

From: Paul E. McKenney
Date: Thu Sep 06 2012 - 16:34:04 EST


On Thu, Sep 06, 2012 at 07:46:16PM +0200, Peter Zijlstra wrote:
> On Thu, 2012-09-06 at 10:41 -0700, Paul E. McKenney wrote:
> > On Thu, Sep 06, 2012 at 09:52:53AM -0400, Steven Rostedt wrote:
> > > On Thu, 2012-09-06 at 15:46 +0200, Peter Zijlstra wrote:
> > > > On Thu, 2012-08-30 at 11:18 -0700, Paul E. McKenney wrote:
> > > > > + get_online_cpus();
> > > > > + for_each_online_cpu(cpu)
> > > > > + for_each_rcu_flavor(rsp)
> > > > > + smp_call_function_single(cpu, rcu_oom_notify_cpu,
> > > > > + rsp, 1);
> > > > > + put_online_cpus();
> > > >
> > > > I guess blasting IPIs around is better than OOM but still.. do you
> > > > really need to wait for each cpu individually, or would a construct
> > > > using on_each_cpu() be possible, or better yet, on_each_cpu_cond()?
> >
> > I rejected on_each_cpu_cond() because it disables preemption across
> > a scan of all CPUs. Probably need to fix that at some point...
>
> It would be rather straight fwd to make a variant that does
> get_online_cpus() though.. but even then there's smp_call_function()
> that does a broadcast, avoiding the need to spray individual IPIs and
> wait for each CPU individually.

And in this case I can live with inexactness with respect to CPUs actually
being hotplugged, so smp_call_function() does sound good.

Thanx, Paul

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