power-libperfmgr: Optimize the wakeup performance and fix unstable boost
Optimize boost:
A more efficient way is to trigger the wakeup boost through mTidSessionListMap, so the time
complexity reduce from O(n^3) to O(n^2).
The original code path:
PSM:wakeSessions() contains a loop that is O(n),
inside the loop, it calls to PHS::wakeup() which call to
PSM::setUclampMinLocked(), and
PSM::setUclampMinLocked() contains two loops O(n^2)
The new code path:
PSM::wakeSessions() directly checks all the ADPF tasks O(n) and
get the wakeup boost value O(n), then directly set the uclamp.min
The time complexity lower to O(n^2).
Fix unstable boost:
The original flow is to find max boost and wake it up from stale state
one by one. But the previous woken ones would not be counted when the later ones finding their max boost value.
The new flow boost all the tasks first, then wake up all those sessions.
Bug: 235510337
Test: Manually playing UIBench -> Transitions -> ActivityTransition
Change-Id: I995673b74401e198eb72188134ba1ebc134f971c
2 files changed