Thread (117 messages) 117 messages, 14 authors, 2013-02-19

Re: [PATCH v5 09/45] smp, cpu hotplug: Fix smp_call_function_*() to prevent CPU offline properly

From: Srivatsa S. Bhat <hidden>
Date: 2013-02-10 20:01:27
Also in: linux-arch, linux-arm-kernel, linuxppc-dev, lkml, netdev

On 02/11/2013 01:26 AM, Paul E. McKenney wrote:
On Mon, Feb 11, 2013 at 01:11:29AM +0530, Srivatsa S. Bhat wrote:
quoted
On 02/09/2013 05:37 AM, Paul E. McKenney wrote:
quoted
On Tue, Jan 22, 2013 at 01:05:10PM +0530, Srivatsa S. Bhat wrote:
quoted
Once stop_machine() is gone from the CPU offline path, we won't be able to
depend on preempt_disable() to prevent CPUs from going offline from under us.

Use the get/put_online_cpus_atomic() APIs to prevent CPUs from going offline,
while invoking from atomic context.

Signed-off-by: Srivatsa S. Bhat <redacted>
Would it make sense for get_online_cpus_atomic() to return the current
CPU number?
Hmm, I'm not so sure. I tried to model it after get_online_cpus(), which doesn't
return anything (for other reasons, of course..)

Moreover, a function name like *_cpu_* returning the CPU number would be intuitive.
But a name such as *_cpus_* (plural) returning a CPU number might appear confusing..

And also I don't think it'll make a huge improvement in the callers.. (We might
be better off avoiding an smp_processor_id() if possible, since this function could
be called in very hot paths).. So I don't see a strong case for returning the
CPU number. But let me know if you think it'll still be worth it for some reason...
I just noted a lot of two-line code sequences in your patch that would be
one line if the CPU number was returned.
Ah, in that case, I'll reconsider your suggestion while working on the next version.
Thanks!

Regards,
Srivatsa S. Bhat
 But I don't feel strongly about
it, so if people are OK with the current version, no problem.

							Thanx, Paul
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help