RE: [patch 1/2] x86: Add pm_play_dead funcptr to power-efficientlyoffline CPUs

From: Pallipadi, Venkatesh
Date: Sat May 23 2009 - 11:05:57 EST




>-----Original Message-----
>From: Peter Zijlstra [mailto:a.p.zijlstra@xxxxxxxxx]
>Sent: Saturday, May 23, 2009 3:45 AM
>To: Pallipadi, Venkatesh
>Cc: mingo@xxxxxxx; tglx@xxxxxxxxxxxxx; hpa@xxxxxxxxx;
>linux-kernel@xxxxxxxxxxxxxxx; lenb@xxxxxxxxxx; Li, Shaohua;
>svaidy@xxxxxxxxxxxxxxxxxx
>Subject: Re: [patch 1/2] x86: Add pm_play_dead funcptr to
>power-efficiently offline CPUs
>
>On Fri, 2009-05-22 at 16:19 -0700, venkatesh.pallipadi@xxxxxxxxx wrote:
>> plain text document attachment
>> (0001-x86-Add-pm_play_dead-funcptr-to-power-efficiently-o.patch)
>> Add a funcptr pm_play_dead (similar to pm_idle) that can take
>> the offline CPUs to the most power efficient idle state.
>>
>> This patch just adds the func pointer. The pointer will get
>initialized
>> by patch that follows.
>
>Since the pm_idle function pointer has given us so much grief, I don't
>think its wise to repeat that particular disaster.
>
>I'd much rather see a framework where idle functions can be registered,
>and selected from based on criteria such as wakeup latency as provided
>by the pm_qos stuff, and power saving.
>
>This framework should be shared between hotplug-idle and the regular
>idle routines. Hotplug would of course not care about things
>like wakeup
>latency and might therefore pick another idle routine.
>

Yes. Thought about that approach. There are issues with that approach however.
- It would be ugly as we have to add logic in various low level idle handlers we have today mwait_idle, default_idle, acpi_mwait_idle, acpi_ioport_idle to make them aware of offline idle case and disable interrupt and not enable interrupt while going idle and not to wake up on interrupt.
- There are limitations on what we can and cannot do when offline. We have had issues with calling acpi methods and/or IO port accesses, during suspend before, so CPU going on suspend only uses C1. Specifically, with the above approach we will have:
1) CPU 1 going offline and starts using regular ACPI IO port C-states.
2) CPU 0 starts suspend and after some points it is unsafe to access ACPI io port accesses, which can potentially result in crash/hangs.

So, I would like to keep ACPI out of play_dead. And keeping idle and play_dead separate seemed to be cleaner way to do it.

Thanks,
Venki

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/