* ARM: idle sleep time for hotplugged cpu
@ 2012-11-05 3:53 Taniya Das
2012-11-05 9:15 ` Russell King - ARM Linux
0 siblings, 1 reply; 4+ messages in thread
From: Taniya Das @ 2012-11-05 3:53 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
I was looking at the arch/arm/process.c:cpu_die, I was wondering why we
do not exit from NOHZ for a hotplugged/offline cpu?
If I understand correctly an offlined cpu too will enter
NOHz(tick_nohz_idle_enter) and update the idle_entrytime. The cpu will die
and it will reenter the idle thread and update idle_entrytime onces it
comes back online and only then it will exit NOHz, but time spent in sleep
idle_sleeptime will be wrongly calculated.
void cpu_idle(void)
{
.....
/* endless idle loop with no priority at all */
while (1) {
idle_notifier_call_chain(IDLE_START);
tick_nohz_idle_enter();--> Offline CPU entering NOHZ
rcu_idle_enter();
while (!need_resched()) {
#ifdef CONFIG_HOTPLUG_CPU
if (cpu_is_offline(smp_processor_id()))
cpu_die(); ---> CPU becomes offline and re-enter the idle thread without
exiting from NOHZ,
#endif
...
}
Is it a good idea to exit from NOHZ before cpu_die() or it could be
achieved in some other way? Please provide your
comments.
--
Thanks & Regards,
Taniya Das.
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation.
^ permalink raw reply [flat|nested] 4+ messages in thread
* ARM: idle sleep time for hotplugged cpu
2012-11-05 3:53 ARM: idle sleep time for hotplugged cpu Taniya Das
@ 2012-11-05 9:15 ` Russell King - ARM Linux
2012-11-06 20:24 ` Steve Muckle
0 siblings, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2012-11-05 9:15 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Nov 05, 2012 at 09:23:38AM +0530, Taniya Das wrote:
> I was looking at the arch/arm/process.c:cpu_die, I was wondering why we
> do not exit from NOHZ for a hotplugged/offline cpu?
Offlined CPUs are not supposed to just 'return' from cpu_die(), and
in actual fact they can't.
^ permalink raw reply [flat|nested] 4+ messages in thread
* ARM: idle sleep time for hotplugged cpu
2012-11-05 9:15 ` Russell King - ARM Linux
@ 2012-11-06 20:24 ` Steve Muckle
2012-11-06 21:00 ` Russell King - ARM Linux
0 siblings, 1 reply; 4+ messages in thread
From: Steve Muckle @ 2012-11-06 20:24 UTC (permalink / raw)
To: linux-arm-kernel
On 11/05/12 01:15, Russell King - ARM Linux wrote:
> On Mon, Nov 05, 2012 at 09:23:38AM +0530, Taniya Das wrote:
>> I was looking at the arch/arm/process.c:cpu_die, I was wondering why we
>> do not exit from NOHZ for a hotplugged/offline cpu?
>
> Offlined CPUs are not supposed to just 'return' from cpu_die(), and
> in actual fact they can't.
Although an offline CPU will not come back into the idle thread by
returning from cpu_die(), I believe the question about exiting nohz mode
before cpu_die() still stands.
>From arch/arm/process.c:cpu_idle() it appears a CPU could enter
pm_idle() for a while (in nohz mode), then execute the inner loop again
and call cpu_die(). Is there the potential for cpu idle time accounting
to get messed up here by not exiting nohz mode prior to the cpu dying,
so that missed ticks from nohz are properly accounted for?
thanks,
Steve
--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
^ permalink raw reply [flat|nested] 4+ messages in thread
* ARM: idle sleep time for hotplugged cpu
2012-11-06 20:24 ` Steve Muckle
@ 2012-11-06 21:00 ` Russell King - ARM Linux
0 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux @ 2012-11-06 21:00 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 06, 2012 at 12:24:20PM -0800, Steve Muckle wrote:
> On 11/05/12 01:15, Russell King - ARM Linux wrote:
> > On Mon, Nov 05, 2012 at 09:23:38AM +0530, Taniya Das wrote:
> >> I was looking at the arch/arm/process.c:cpu_die, I was wondering why we
> >> do not exit from NOHZ for a hotplugged/offline cpu?
> >
> > Offlined CPUs are not supposed to just 'return' from cpu_die(), and
> > in actual fact they can't.
>
> Although an offline CPU will not come back into the idle thread by
> returning from cpu_die(), I believe the question about exiting nohz mode
> before cpu_die() still stands.
Well, that depends on the design of all that. I don't know that, but
what I do know is we're doing exactly the same as x86 which I presume
is correct.
> >From arch/arm/process.c:cpu_idle() it appears a CPU could enter
> pm_idle() for a while (in nohz mode), then execute the inner loop again
> and call cpu_die(). Is there the potential for cpu idle time accounting
> to get messed up here by not exiting nohz mode prior to the cpu dying,
> so that missed ticks from nohz are properly accounted for?
Why does the idle time matter if the CPU has been taken offline?
In any case, I think this is a question for the CPU idle people; it's not
a feature that I've ever knowingly used or have any interest in using at
the moment.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-11-06 21:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-05 3:53 ARM: idle sleep time for hotplugged cpu Taniya Das
2012-11-05 9:15 ` Russell King - ARM Linux
2012-11-06 20:24 ` Steve Muckle
2012-11-06 21:00 ` Russell King - ARM Linux
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).