On Wed, May 15, 2013 at 07:05:10PM +0100, Sebastian Capella wrote:
Hi Liviu,
Regarding your comments about using the C-state instead of the residency, we based off of the existing mcpm_suspend call which currently takes residency (with a 0 meaning lowest power).
We used calls (including mcpm_suspend) in the hot plug/suspend path. However, it does not know about c-states. I suspect others may want to do the same. Do you know how suspend is done on tc2?
Regarding guest kernels, I don't think I understand the implications. If we migrate between cores (having different parameters) in the middle of a cstate transition, can we have correct behavior? Wouldn't it be worse to migrate to a lower c-state then we had intended?
Thanks,
Sebastian
On 15 May 2013 10:07, Jon Medhurst (Tixy) <tixy@linaro.orgmailto:tixy@linaro.org> wrote: On Wed, 2013-05-15 at 09:49 -0700, Sebastian Capella wrote:
Thanks Daniel!
Liviu,
I have been using on the linux-linaro branch in the linux-linaro-tracking repository here:
https://git.linaro.org/gitweb?p=kernel/linux-linaro-tracking.git%3Ba=shortlo...
Generally, that's the Linaro kernel tree people should use and what is built daily and released monthly.
It's just it hasn't moved to 3.10 yet (will do in the next day or so) but the topic branches which feed into it (that Liviu pointed out) have already made that move.
-- Tixy
Hi Sebastian,
From previous discussions between Achin, Charles and Nico I am aware that Nico has decided for the moment that target residency should be useful enough to be used by MCPM. That is because Nico is a big proponent of doing everything in the kernel and keeping the firmware dumb and (mostly) out of the way. However, the view that we have here at ARM (but I will only speak in my name here) is that in order to have alignment with AArch64 kernel and the way it is using PSCI interface, we should be moving the kernel on AArch32 and armv7a to run in non-secure mode. At that time, the kernel will make PSCI calls to do CPU_ON, CPU_SUSPEND, etc. and the aim is to provide to the firmware the deepest C-state that the core can support going to without being woken up to do any additional state management. It is then the latitude of the firmware to put the core in that state or to tally the sum of all requests in a cluster and decide to put the cores and the cluster in the lowest common C-state.
Regarding the migration of the guest kernels, it should be transparent (to a certain extent) wether on resume it is running on the same core or it has been migrated. The host OS should have a better understanding on what can be achieved and what invariants it can still hold, but it should not be limited to do that in a specific amount of time. Lets take an example: one core in the cluster says that it can go as deep as cluster shutdown but it does so in your use of the API by saying that it would like to sleep for at least amount X of time. The host however has to tally all the cores in the cluster in order to decide if the cluster can be shutdown, has to do a lot of cache maintainance and state saving, turning off clocks and devices etc, and in doing so is going to consume some compute cycles; it will then substract the time spent making a decision and doing the cleanup and then figure out if there is still time left for each of the cores to go to sleep for the specified amount of time. All this implies that the guest has to have an understanding of the time the host is spending in doing maintainance operations before asking the hypervisor for a target residency and the host still has to do the math again to validate that the guest request is still valid.
If we choose to use the target C-state, the request validation is simplified to a comparision between each core target C-state and the lowest common C-state per cluster, all done in the host.
Of course, by describing C-states in terms of target residency times both schemes can be considered equivalent. But that target residency time is not constant for all code paths and for all conditions and that makes the decision process more complicated.
Hope that provides some clarification.
Best regards, Liviu