[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110930142304.c455799e.akpm00@gmail.com>
Date: Fri, 30 Sep 2011 14:23:04 -0700
From: Andrew Morton <akpm00@...il.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Jeremy Fitzhardinge <jeremy@...p.org>,
Rusty Russell <rusty@...tcorp.com.au>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"H. Peter Anvin" <hpa@...or.com>, Tejun Heo <htejun@...il.com>,
Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH RFC] stop_machine: make stop_machine safe and efficient
to call early
On Fri, 30 Sep 2011 12:34:54 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:
> On Fri, 2011-09-30 at 09:28 -0700, Jeremy Fitzhardinge wrote:
> > Make stop_machine() safe to call early in boot, before SMP has been
> > set up, by simply calling the callback function directly if there's
> > only one CPU online.
> >
> > Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
> > Cc: Tejun Heo <tj@...nel.org>
> > Cc: Rusty Russell <rusty@...tcorp.com.au>
> > Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> > Cc: Andrew Morton <akpm@...ux-foundation.org>
> > Cc: H. Peter Anvin <hpa@...ux.intel.com>
> > Cc: Ingo Molnar <mingo@...e.hu>
> > Cc: Steven Rostedt <rostedt@...dmis.org>
> >
> > diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
> > index ba5070c..2df15ca 100644
> > --- a/kernel/stop_machine.c
> > +++ b/kernel/stop_machine.c
> > @@ -485,6 +485,9 @@ int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus)
> > .num_threads = num_online_cpus(),
> > .active_cpus = cpus };
> >
> > + if (smdata.num_threads == 1)
> > + return (*fn)(data);
>
> Doesn't interrupts need to be disabled here too? As stop machine
> functions also guarantee that they will not be interrupted by
> interrupts.
>
If we wish to truly emulate the stop_machine_cpu_stop() callback
environment then we should run hard_irq_disable() as well?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists