Skip to content

alarmtimer: Rework the suspend flow in alarmtimer

Pranav Prasad lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyIn review
  2. v22 patches 7 repliesSuperseded
  3. v12 patches 4 repliesSuperseded

Changes in v3 from v2 from the cover letter

- Reversed the order of patches
- Formatted variable declarations
- Moved the RTC device check out of alarmtimer_get_soonest()
- Reinstated the check for pending alarm in alarmtimer_suspend()

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2alarmtimer: Add PM notifier to check early for imminent alarmkernel/time/alarmtimer.c+79 -211 reply
2/2alarmtimer: Create sysfs to make alarm check window configurablekernel/time/alarmtimer.c+64 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] alarmtimer: Rework the suspend flow in alarmtimer

Hi!

During the driver suspend phase of kernel suspend, alarmtimer's suspend callback is invoked and it identifies the earliest next wakeup alarm and programs that into the HW real time clock (RTC). However, there is an exception to this process. If the next alarm is within the next 2 seconds, the alarmtimer driver fails to suspend. In this case, a non-trivial amount of power is spent to freeze and unfreeze all userspace processes and to suspend and resume a number of devices. In the vast majority of cases, the imminent alarm that caused the failure was likely already scheduled before suspend even started. This provides an opportunity to reduce power consumption if the suspend failure decision is made earlier in the suspend flow, before the unnecessary extra work is done.

This patch series aims to achieve a kernel suspend flow in which the check for an imminent alarm is performed early during the suspend prepare phase.

Changes in v3 from v2:

- Reversed the order of patches
- Formatted variable declarations
- Moved the RTC device check out of alarmtimer_get_soonest()
- Reinstated the check for pending alarm in alarmtimer_suspend()

Changes in v2 from v1:

- Moved the pm_wakeup_event call to the PM notifier
- Added a check for RTC device in the PM notifier

Pranav Prasad (2):
alarmtimer: Add PM notifier to check early for imminent alarm
alarmtimer: Create sysfs to make alarm check window configurable

 kernel/time/alarmtimer.c | 164 +++++++++++++++++++++++++++++++++------
 1 file changed, 140 insertions(+), 24 deletions(-)
Signature · 1 line
2.43.0.687.g38aa6559b0-goog