Making timerfd non-blocking in alarm manager.
Alarm manager uses timerfd with epoll_wait, so there can be a race where read blocks if timerfd_settime was called after epoll_wait returns and before read is called. Since epoll_wait returned, we should be treating that as sufficient signal that the timer expired. In general, it should be better to have a non-blocking fd with epoll_wait as the kernel holds a wakelock until the next epoll_wait and if we move the timer to the future the system should be waiting inside epoll_wait and not inside read, to allow the system to go into suspend. This is also expected to mitigate or eliminate cases where we are seeing alarm delivery stuck while the system is stuck somewhere in read, while the higher level code keeps waiting for it to return. Test: builds, boots, existing tests pass: atest CtsAlarmManagerTestCases Bug: 78560047 Change-Id: Idbb3bf94b7e750686701757d2d27ad2d3246294f
Loading
Please register or sign in to comment