lmkd: Fix usage of ro.lmk.kill_heaviest_task property
lmkd should use ro.lmk.kill_heaviest_task property to select between
algorithms for victim selection. Set ro.lmk.kill_heaviest_task default
value to false in order to keep it compatible with previous versions
of lmkd (killing the heaviest task is a new mechanism).
Bug: 77299493
Bug: 75322373
Change-Id: I78d2dc79d9c54e636c26665605518d9c87b535b3
Merged-In: I78d2dc79d9c54e636c26665605518d9c87b535b3
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
(cherry picked from commit 818b59b2292f87c3781a6f7a288d10e2453b0d13)
diff --git a/lmkd/lmkd.c b/lmkd/lmkd.c
index 5f27dfc..6b0d8be 100644
--- a/lmkd/lmkd.c
+++ b/lmkd/lmkd.c
@@ -771,10 +771,8 @@
struct proc *procp;
while (true) {
- if (low_ram_device)
- procp = proc_adj_lru(i);
- else
- procp = proc_get_heaviest(i);
+ procp = kill_heaviest_task ?
+ proc_get_heaviest(i) : proc_adj_lru(i);
if (!procp)
break;
@@ -1198,7 +1196,7 @@
downgrade_pressure =
(int64_t)property_get_int32("ro.lmk.downgrade_pressure", 100);
kill_heaviest_task =
- property_get_bool("ro.lmk.kill_heaviest_task", true);
+ property_get_bool("ro.lmk.kill_heaviest_task", false);
low_ram_device = property_get_bool("ro.config.low_ram", false);
kill_timeout_ms =
(unsigned long)property_get_int32("ro.lmk.kill_timeout_ms", 0);