Re: [PATCH 2/2] PM / Runtime: use deferrable timer for autosuspend

From: Rafael J. Wysocki
Date: Mon Jan 18 2016 - 19:28:33 EST


On Tuesday, January 12, 2016 06:17:20 PM Lucas Stach wrote:
> The timeouts used in PM autosuspend are relatively coarse (the shortest
> I could find in a quick search through the kernel is 50ms). As they are
> already handled relaxed by saving the overhead of always rearming the
> timer by opportunistically suspending a device a bit early, it should
> not matter if the the timeout is missed slightly.
>
> By using a deferrable timer the CPU will not be woken just to handle
> the autosuspend timeout, but handling will be batched with other
> wakeups in the system.

On some platforms this may increase energy consumption.

Say you have a deep platform-wide idle state (say it is called "C10").
Say this state can only be entered by the platform if device X has
been suspended. The driver for X has an autosuspend delay of 50 ms,
but the platform can stay up to 0.5s in idle on the average.

Say the last CPU core goes idle and asks for "C10", but X hasn't been
suspended yet, so the platform enters a shallower idle state and
with this change applied it stays in that state for up to 0.5s, but
otherwise it would have been woken up by the X driver's autosuspend
timer and might be able to enter "C10" earlier.

So, I'm not really liking this change that much.

Thanks,
Rafael