lmkd: Do not kill perceptible apps due to low swap if above min wmark am: 48135c4cba am: d6d8a3dc55
Change-Id: I8d6a9376c361279c9833b19afdaac5a83d8a9f2a
This commit is contained in:
commit
c9e47704a9
8
lmkd.cpp
8
lmkd.cpp
|
|
@ -2396,12 +2396,20 @@ static void mp_event_psi(int data, uint32_t events, struct polling_params *poll_
|
||||||
snprintf(kill_desc, sizeof(kill_desc), "device is low on swap (%" PRId64
|
snprintf(kill_desc, sizeof(kill_desc), "device is low on swap (%" PRId64
|
||||||
"kB < %" PRId64 "kB) and thrashing (%" PRId64 "%%)",
|
"kB < %" PRId64 "kB) and thrashing (%" PRId64 "%%)",
|
||||||
mi.field.free_swap * page_k, swap_low_threshold * page_k, thrashing);
|
mi.field.free_swap * page_k, swap_low_threshold * page_k, thrashing);
|
||||||
|
/* Do not kill perceptible apps unless below min watermark */
|
||||||
|
if (wmark < WMARK_LOW) {
|
||||||
|
min_score_adj = PERCEPTIBLE_APP_ADJ + 1;
|
||||||
|
}
|
||||||
} else if (swap_is_low && wmark < WMARK_HIGH) {
|
} else if (swap_is_low && wmark < WMARK_HIGH) {
|
||||||
/* Both free memory and swap are low */
|
/* Both free memory and swap are low */
|
||||||
kill_reason = LOW_MEM_AND_SWAP;
|
kill_reason = LOW_MEM_AND_SWAP;
|
||||||
snprintf(kill_desc, sizeof(kill_desc), "%s watermark is breached and swap is low (%"
|
snprintf(kill_desc, sizeof(kill_desc), "%s watermark is breached and swap is low (%"
|
||||||
PRId64 "kB < %" PRId64 "kB)", wmark > WMARK_LOW ? "min" : "low",
|
PRId64 "kB < %" PRId64 "kB)", wmark > WMARK_LOW ? "min" : "low",
|
||||||
mi.field.free_swap * page_k, swap_low_threshold * page_k);
|
mi.field.free_swap * page_k, swap_low_threshold * page_k);
|
||||||
|
/* Do not kill perceptible apps unless below min watermark */
|
||||||
|
if (wmark < WMARK_LOW) {
|
||||||
|
min_score_adj = PERCEPTIBLE_APP_ADJ + 1;
|
||||||
|
}
|
||||||
} else if (wmark < WMARK_HIGH && swap_util_max < 100 &&
|
} else if (wmark < WMARK_HIGH && swap_util_max < 100 &&
|
||||||
(swap_util = calc_swap_utilization(&mi)) > swap_util_max) {
|
(swap_util = calc_swap_utilization(&mi)) > swap_util_max) {
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue