[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51CBE4EF.5040302@linux.vnet.ibm.com>
Date: Thu, 27 Jun 2013 12:38:31 +0530
From: "Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
To: Ralf Baechle <ralf@...ux-mips.org>
CC: tglx@...utronix.de, peterz@...radead.org, tj@...nel.org,
oleg@...hat.com, paulmck@...ux.vnet.ibm.com, rusty@...tcorp.com.au,
mingo@...nel.org, akpm@...ux-foundation.org, namhyung@...nel.org,
walken@...gle.com, vincent.guittot@...aro.org,
laijs@...fujitsu.com, rostedt@...dmis.org,
wangyun@...ux.vnet.ibm.com, xiaoguangrong@...ux.vnet.ibm.com,
sbw@....edu, fweisbec@...il.com, zhong@...ux.vnet.ibm.com,
nikunj@...ux.vnet.ibm.com, linux-pm@...r.kernel.org,
linux-arch@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
David Daney <david.daney@...ium.com>,
Yong Zhang <yong.zhang0@...il.com>,
Sanjay Lal <sanjayl@...asys.com>,
"Steven J. Hill" <sjhill@...s.com>,
John Crispin <blogic@...nwrt.org>,
Florian Fainelli <florian@...nwrt.org>,
linux-mips@...ux-mips.org
Subject: Re: [PATCH v2 38/45] MIPS: Use get/put_online_cpus_atomic() to prevent
CPU offline
On 06/26/2013 07:09 PM, Ralf Baechle wrote:
> On Wed, Jun 26, 2013 at 02:02:57AM +0530, Srivatsa S. Bhat wrote:
>
>> Once stop_machine() is gone from the CPU offline path, we won't be able
>> to depend on disabling preemption 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.
>
> I think the same change also needs to be applied to r4k_on_each_cpu() in
> arch/mips/mm/c-r4k.c which currently looks like:
>
> static inline void r4k_on_each_cpu(void (*func) (void *info), void *info)
> {
> preempt_disable();
>
> #if !defined(CONFIG_MIPS_MT_SMP) && !defined(CONFIG_MIPS_MT_SMTC)
> smp_call_function(func, info, 1);
> #endif
> func(info);
> preempt_enable();
> }
>
Thanks for pointing this out! I'll include changes to this code in my
next version.
Regards,
Srivatsa S. Bhat
> This is a slightly specialized version of on_each_cpu() which only calls
> out to other CPUs in actual multi-core environments and also - unlike
> on_each_cpu() doesn't disable interrupts for the sake of better
> interrupt latencies.
>
> Which reminds me ...
>
> Andrew, I was wondering why did 78eef01b0fae087c5fadbd85dd4fe2918c3a015f
> [[PATCH] on_each_cpu(): disable local interrupts] disable interrupts?
> The log is:
>
> ----- snip -----
> When on_each_cpu() runs the callback on other CPUs, it runs with local
> interrupts disabled. So we should run the function with local interrupts
> disabled on this CPU, too.
>
> And do the same for UP, so the callback is run in the same environment on bo
> UP and SMP. (strictly it should do preempt_disable() too, but I think
> local_irq_disable is sufficiently equivalent).
> [...]
> ----- snip -----
>
> I'm not entirely convinced the symmetry between UP and SMP environments is
> really worth it. Would anybody mind removing the local_irq_disable() ...
> local_irq_enable() from on_each_cpu()?
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists