mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
alarmtimer: Minimize wakeup time
Alarmtimer sets its wakeup timeout to 2s no matter the actual time to nearest timer expiration. This can cause device to be awake for more than needed. To fix this set wakeup timeout to min + 1 ms for safety margin. Tests revealed that average timer expiration is 1150ms in the future which suggests there is a room avilable to minimize wakeup times. Before this change device would enter sleep not earlier than 2s after alarmtimer suspend error (-EBUSY). With this change average suspend after alarmtimer suspend error time went down to 1.5s with a minimum of 0.248ms (after filtering results higher than 2.6s). This should lead to noticeable power savings as Android uses alarmtimer quite frequently. Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com> Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live> Signed-off-by: azrim <mirzaspc@gmail.com>
This commit is contained in:
parent
b3fc0671f9
commit
1cceb97ee8
@ -312,7 +312,7 @@ static int alarmtimer_suspend(struct device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (ktime_to_ns(min) < 2 * NSEC_PER_SEC) {
|
if (ktime_to_ns(min) < 2 * NSEC_PER_SEC) {
|
||||||
__pm_wakeup_event(ws, 2 * MSEC_PER_SEC);
|
__pm_wakeup_event(ws, ktime_to_ms(min) + 1);
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user