From ed8fc168e6fff4f7e7ec24e8120d0a489699bd65 Mon Sep 17 00:00:00 2001 From: Yuming Han Date: Mon, 4 Jul 2022 14:02:09 +0800 Subject: [PATCH] lmkd : Fixed running wrong for Go devices when use_minfree_levels is TRUE The lmkd run wrong for Go devices, because min_score_adj is unused when use_minfree_levels is set TURE. Bug: 237947900 Signed-off-by: Yuming Han Change-Id: I717561cd9e5f4d1a2ca60d9fc84adcd6e129420a --- lmkd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lmkd.cpp b/lmkd.cpp index d885a2d..a2e7b8e 100644 --- a/lmkd.cpp +++ b/lmkd.cpp @@ -3069,7 +3069,8 @@ static void mp_event_common(int data, uint32_t events, struct polling_params *po do_kill: if (low_ram_device) { /* For Go devices kill only one task */ - if (find_and_kill_process(level_oomadj[level], NULL, &mi, &wi, &curr_tm, NULL) == 0) { + if (find_and_kill_process(use_minfree_levels ? min_score_adj : level_oomadj[level], + NULL, &mi, &wi, &curr_tm, NULL) == 0) { if (debug_process_killing) { ALOGI("Nothing to kill"); }