Re: [PATCH 3/4] alarmtimer: Reject imminent-alarm suspend in PM_SUSPEND_PREPARE
From: John Stultz
Date: Wed Dec 02 2026 - 14:22:34 EST
On Mon, Nov 30, 2026 at 10:13 PM Samuel Wu <wusamuel@xxxxxxxxxx> wrote:
>
> The imminent alarm check is in the device suspend stage, which occurs after
> freezing tasks, preparing devices, and suspend devices. For a suspend
> attempt aborted by an imminent alarm, the kernel goes through a relatively
> expensive operation of processing several suspend stages and then unwinding
> those same operations.
>
> Register a PM notifier to check for imminent alarm earlier in the suspend
> sequence, at the PM_SUSPEND_PREPARE stage of suspend. This earlier imminent
> alarm check reduces redundant work such as freeze, prepare, and thaw.
>
> This significantly drops imminent-alarm suspend abort time:
> - ~220 ms to ~20 ms on Pixel 9 (v7.3)
> - ~90 ms to ~0.1 ms on Pixel Watch (v6.12)
>
> Suggested-by: Rafael J. Wysocki <rafael@xxxxxxxxxx>
> Signed-off-by: Samuel Wu <wusamuel@xxxxxxxxxx>
I know this issue has been lingering for a long time, so thanks for reviving it!
Acked-by: John Stultz <jstultz@xxxxxxxxxx>
thanks
-john