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

Skip to content
Commit 8a2e9fbe authored by Kalesh Singh's avatar Kalesh Singh
Browse files

AMS: Proactive Kills - Minimal Implementation



Under certain scenarios, PSI triggers may not wake up LMKD in time to
relieve system resource contention. This is especially true in the case
of MGLRU which makes smarter reclaim decisions and genereates less PSI.

Additionally, reclaim of anonymous memory suffers when swap is full and
under pressure the anon pages can be reactivated in an attempt to swap.
This causes hot/cold page inversion. MGLRU detects this situation and
doesn't swap but it leads to a similar scenario where the anon generations
are in effect inverted (hot/cold generation inversion) if the swap
contention doesn't decrease.

To safe guard these cases, impose a minimum free swap threshold. The
default is 10% but will be configurable from experiment flags. When swap
drops below this limit, the LRU cached app is killed to help relieve
swap pressure. Most cached apps contribute to swap usage because of the
proactive app compaction, which may not necessarily mean we have
memory pressure.

Note that Andorid uses ZRAM (in-memory compressed swap). ZRAM size is
virtual, so imposing a threshold on swap is not the same as reserving
swap space.

Bug: 259307176
Bug: 249601646
Test: Run ACT, observe low swap kills
Merged-In: I089d37fc067b9a85aabbd70b4513a209dfafa96d
Change-Id: I089d37fc067b9a85aabbd70b4513a209dfafa96d
Signed-off-by: default avatarKalesh Singh <kaleshsingh@google.com>
parent 6cc66e45
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment