lmkd: Fix min_score_adj to exclude killing foreground processes
In the cases when foreground processes should not be killed min_score_adjust should be set above PERCEPTIBLE_APP_ADJ to prevent such kills. Bug: 155709603 Test: memory stress test with multiple foreground apps Signed-off-by: Suren Baghdasaryan <surenb@google.com> Change-Id: If187654b8001ce843ec6085ccd2042d75a986dae
This commit is contained in:
parent
5096d16091
commit
0e589f61ba
4
lmkd.cpp
4
lmkd.cpp
|
|
@ -2400,7 +2400,7 @@ static void mp_event_psi(int data, uint32_t events, struct polling_params *poll_
|
||||||
PRId64 "%%)", wmark > WMARK_LOW ? "min" : "low", thrashing);
|
PRId64 "%%)", wmark > WMARK_LOW ? "min" : "low", thrashing);
|
||||||
cut_thrashing_limit = true;
|
cut_thrashing_limit = true;
|
||||||
/* Do not kill perceptible apps because of thrashing */
|
/* Do not kill perceptible apps because of thrashing */
|
||||||
min_score_adj = PERCEPTIBLE_APP_ADJ;
|
min_score_adj = PERCEPTIBLE_APP_ADJ + 1;
|
||||||
} else if (reclaim == DIRECT_RECLAIM && thrashing > thrashing_limit) {
|
} else if (reclaim == DIRECT_RECLAIM && thrashing > thrashing_limit) {
|
||||||
/* Page cache is thrashing while in direct reclaim (mostly happens on lowram devices) */
|
/* Page cache is thrashing while in direct reclaim (mostly happens on lowram devices) */
|
||||||
kill_reason = DIRECT_RECL_AND_THRASHING;
|
kill_reason = DIRECT_RECL_AND_THRASHING;
|
||||||
|
|
@ -2408,7 +2408,7 @@ static void mp_event_psi(int data, uint32_t events, struct polling_params *poll_
|
||||||
PRId64 "%%)", thrashing);
|
PRId64 "%%)", thrashing);
|
||||||
cut_thrashing_limit = true;
|
cut_thrashing_limit = true;
|
||||||
/* Do not kill perceptible apps because of thrashing */
|
/* Do not kill perceptible apps because of thrashing */
|
||||||
min_score_adj = PERCEPTIBLE_APP_ADJ;
|
min_score_adj = PERCEPTIBLE_APP_ADJ + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Kill a process if necessary */
|
/* Kill a process if necessary */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue