Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit aadcf949 authored by Alec Mouri's avatar Alec Mouri
Browse files

Reduce gratuitous resets for OneShotTimer

OneShotTimer::reset just resets an internal timer thread for it to go
back to sleep. When just implemented with semaphores, this introduces a
lot of syscall churn due to posting a semaphore -> waking up the timer
thread -> having the thread go back to sleep. Instead, we can avoid
resetting the timer if we know that the thread is about to wait for a
short amount of time, and only reset the timer if the thread is in an
idle state.

This patch reduces instruction counts by 5%, and CPU cycles incurred by
an additional 5%.

Bug: 232272570
Test: bouncy ball

Change-Id: I83f968042395857237875aab8dca0e6b90d392cb
parent 8ffb0288
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment