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

Skip to content
Commit 553e8688 authored by Michael Wachenschwanz's avatar Michael Wachenschwanz
Browse files

Simplify OomAdjusterModernImpl traversal

The current implementation of OomAdjusterModernImpl requires every
procState and oomAdj change to be reported to the ProcessRecordNodes
data structure. If ever there is a mismatch between a ProcessStateRecord
and the slot that it occupies, moving the node risks moving the LAST
reference of a slot to the wrong slot (which will cause a NPE during
traversal).

To avoid this fragile behavior, the ProcessRecordNodes struct is now
reworked to only keep track of what processes need to computed in the
current update (instead of keeping track of all processes). This allows
for ProcessRecords to be moved slots without handling the slot it was
previously in.

Flag: com.android.server.am.simplify_process_traversal
Fixes: 336178916
Test: atest MockingOomAdjusterTests
Change-Id: Ibf2a15fa3141ec1bcb9fe7548fbf977ce6f76e7a
parent 40349d86
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