From: amit.kachhap@linaro.org (Amit Kachhap)
To: linux-arm-kernel@lists.infradead.org
Subject: [patch] ARM: smpboot: Enable interrupts after marking CPU online/active
Date: Fri, 7 Oct 2011 19:39:14 +0530 [thread overview]
Message-ID: <CAK44p202Q5L6PNfGuAz3J5KyBPQADPqszLORCUptgJanGpCkYA@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.02.1110071354310.3240@ionos>
On 7 October 2011 17:47, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Fri, 7 Oct 2011, Kukjin Kim wrote:
>> I think, basically, if SPIs in GIC are used in local timer, the routing
>> interrupt like calling irq_set_affinity() to offline CPUs should be
>> available when boot time before calling set_cpu_online() because as you know
>> the local_timer_setup() which includes setup interrupt is called in
>> percpu_timer_setup() now...
>>
>> Is there any way to get the flags of struct irqaction from struct irq_data
>> in gic_set_affinity()? Or?
>
> No, and you should not even think about it at all.
>
> The problem I can see from all this discussion is related to the early
> enabling of interrupts and the per cpu timer setup before the cpu is
> marked online. I really do not understand at all why this needs to be
> done in order to call calibrate_delay().
>
> calibrate_delay() monitors jiffies, which are updated from the CPU
> which is waiting for the new CPU to set the online bit.
>
> So you simply can call calibrate_delay() on the new CPU just from the
> interrupt disabled region and move the local timer setup after you
> stored the cpu data and before enabling interrupts.
>
> This solves both the cpu_online vs. cpu_active problem and the
> affinity setting of the per cpu timers.
>
> Thanks,
>
> ? ? ? ?tglx
> ----
> Index: linux-2.6/arch/arm/kernel/smp.c
> ===================================================================
> --- linux-2.6.orig/arch/arm/kernel/smp.c
> +++ linux-2.6/arch/arm/kernel/smp.c
> @@ -301,17 +301,7 @@ asmlinkage void __cpuinit secondary_star
> ? ? ? ? */
> ? ? ? ?platform_secondary_init(cpu);
>
> - ? ? ? /*
> - ? ? ? ?* Enable local interrupts.
> - ? ? ? ?*/
> ? ? ? ?notify_cpu_starting(cpu);
> - ? ? ? local_irq_enable();
> - ? ? ? local_fiq_enable();
> -
> - ? ? ? /*
> - ? ? ? ?* Setup the percpu timer for this CPU.
> - ? ? ? ?*/
> - ? ? ? percpu_timer_setup();
>
> ? ? ? ?calibrate_delay();
>
> @@ -323,10 +313,23 @@ asmlinkage void __cpuinit secondary_star
> ? ? ? ? * before we continue.
> ? ? ? ? */
> ? ? ? ?set_cpu_online(cpu, true);
> +
> + ? ? ? /*
> + ? ? ? ?* Setup the percpu timer for this CPU.
> + ? ? ? ?*/
> + ? ? ? percpu_timer_setup();
I tested these modifications on samsung exynos4 platform and they work
fine with almost same bogomips. I also enabled cpu topology patches
and they also don't create any race conditions. Looks like a good
approach.
> +
> ? ? ? ?while (!cpu_active(cpu))
> ? ? ? ? ? ? ? ?cpu_relax();
>
> ? ? ? ?/*
> + ? ? ? ?* cpu_active bit is set, so it's safe to enable interrupts
> + ? ? ? ?* now.
> + ? ? ? ?*/
> + ? ? ? local_irq_enable();
> + ? ? ? local_fiq_enable();
> +
> + ? ? ? /*
> ? ? ? ? * OK, it's off to the idle thread for us
> ? ? ? ? */
> ? ? ? ?cpu_idle();
>
next prev parent reply other threads:[~2011-10-07 14:09 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-08 21:57 [patch] ARM: smpboot: Enable interrupts after marking CPU online/active Thomas Gleixner
2011-09-09 4:17 ` Santosh
2011-09-13 13:30 ` amit kachhap
2011-09-13 13:32 ` Russell King - ARM Linux
2011-09-13 17:22 ` Vincent Guittot
2011-09-13 17:53 ` Russell King - ARM Linux
2011-09-13 20:48 ` Thomas Gleixner
2011-09-13 22:37 ` Russell King - ARM Linux
2011-09-14 1:10 ` Frank Rowand
2011-09-14 6:55 ` Vincent Guittot
2011-09-23 8:40 ` Russell King - ARM Linux
2011-09-26 7:26 ` Amit Kachhap
2011-09-29 7:40 ` Kukjin Kim
2011-09-29 20:12 ` Thomas Gleixner
2011-09-30 6:42 ` Kukjin Kim
2011-10-07 9:49 ` Kukjin Kim
2011-10-07 12:17 ` Thomas Gleixner
2011-10-07 14:09 ` Amit Kachhap [this message]
2011-10-10 4:28 ` Kukjin Kim
2011-10-19 21:16 ` Dima Zavin
2011-10-20 0:32 ` Dima Zavin
2011-11-15 21:54 ` Stepan Moskovchenko
2011-11-15 22:00 ` Thomas Gleixner
2011-12-14 0:13 ` Dima Zavin
2011-12-14 0:26 ` Thomas Gleixner
2011-12-15 16:09 ` Peter Zijlstra
2011-11-15 23:27 ` Dima Zavin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAK44p202Q5L6PNfGuAz3J5KyBPQADPqszLORCUptgJanGpCkYA@mail.gmail.com \
--to=amit.kachhap@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).