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
Loading
Please register or sign in to comment