Commit f22332b
Set an upper limit to next wakeup time
:Release Notes:
Set next wakeup time to 10 sec if it exceeds the max value of 7 days.
:Detailed Notes:
Since sleepd starts much earlier in the boot sequence, when it tries to
read the system time its set to some invalid time, thereby causing the
wakeup time to overflow the max value that an unsigned int can hold and
at times making it negative causing GSource event loop to trigger again
and again until the system time is set to an appropriate value.
So to fix this issue, sleepd now sets up an upper limit to the value of
the next wakeup time to 7 days (because the next alarm can never be set for
a time beyond one week), and if the value exceeds that, its set to 10 sec,
so that it can come back up after 10 sec and recalculate the alarm expiry
then by when the system time would also have been set correctly.
:Testing Performed:
Verified that with this change sleepd doesnt trigger unnecessary SQLite
reads for recalculating alarms and the bootchart shows that sleepd isnt
consuming large amount of CPU cycles as it was doing before.
:Issues Addressed:
[GF-41100] sleepd consuming large amout of CPU cycles during boot
Open-webOS-DCO-1.0-Signed-off-by: Sapna Todwal <sapna.todwal@lge.com>
Change-Id: I3c2a0d66ccaa81573b6e03fd13c996575de0d917
Reviewed-on: https://g2g.palm.com/4485
Reviewed-by: DCO Verification
Reviewed-by: Keith Derrick <keith.derrick@lge.com>
Tested-by: Sapna Todwal <sapna.todwal@lge.com>1 parent 6a8b657 commit f22332b
1 file changed
+12
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
579 | 579 | | |
580 | 580 | | |
581 | 581 | | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
582 | 590 | | |
583 | 591 | | |
584 | 592 | | |
| |||
626 | 634 | | |
627 | 635 | | |
628 | 636 | | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
629 | 641 | | |
630 | 642 | | |
631 | 643 | | |
| |||
0 commit comments