add min score option to PRESSURE_AFTER_KILL
Adjust lmk cycle after kill to honor an optional min score. Test: cycle after kill under mem pressure honors specified score Bug: 309380316 Change-Id: I9ab8e29b58846cc291acb2834638ddf7a7759eca Signed-off-by: Matt Stephenson <stephensonmatt@google.com>
This commit is contained in:
parent
5789f8506a
commit
18578a55d0
|
|
@ -88,6 +88,10 @@ properties:
|
||||||
- `ro.lmk.psi_complete_stall_ms`: complete PSI stall threshold in milliseconds for
|
- `ro.lmk.psi_complete_stall_ms`: complete PSI stall threshold in milliseconds for
|
||||||
triggering critical memory notification. Default =
|
triggering critical memory notification. Default =
|
||||||
700
|
700
|
||||||
|
- `ro.lmk.pressure_after_kill_min_score`: min oom_adj_score score threshold for
|
||||||
|
cycle after kill used to allow blocking of killing
|
||||||
|
critical processes when not enough memory was freed
|
||||||
|
in a kill cycle. Default score = 0.
|
||||||
|
|
||||||
lmkd will set the following Android properties according to current system
|
lmkd will set the following Android properties according to current system
|
||||||
configurations:
|
configurations:
|
||||||
|
|
|
||||||
4
lmkd.cpp
4
lmkd.cpp
|
|
@ -204,6 +204,7 @@ static int64_t downgrade_pressure;
|
||||||
static bool low_ram_device;
|
static bool low_ram_device;
|
||||||
static bool kill_heaviest_task;
|
static bool kill_heaviest_task;
|
||||||
static unsigned long kill_timeout_ms;
|
static unsigned long kill_timeout_ms;
|
||||||
|
static int pressure_after_kill_min_score;
|
||||||
static bool use_minfree_levels;
|
static bool use_minfree_levels;
|
||||||
static bool per_app_memcg;
|
static bool per_app_memcg;
|
||||||
static int swap_free_low_percentage;
|
static int swap_free_low_percentage;
|
||||||
|
|
@ -2769,6 +2770,7 @@ static void mp_event_psi(int data, uint32_t events, struct polling_params *poll_
|
||||||
* This might happen when a process is consuming memory faster than reclaim can
|
* This might happen when a process is consuming memory faster than reclaim can
|
||||||
* free even after a kill. Mostly happens when running memory stress tests.
|
* free even after a kill. Mostly happens when running memory stress tests.
|
||||||
*/
|
*/
|
||||||
|
min_score_adj = pressure_after_kill_min_score;
|
||||||
kill_reason = PRESSURE_AFTER_KILL;
|
kill_reason = PRESSURE_AFTER_KILL;
|
||||||
strncpy(kill_desc, "min watermark is breached even after kill", sizeof(kill_desc));
|
strncpy(kill_desc, "min watermark is breached even after kill", sizeof(kill_desc));
|
||||||
} else if (level == VMPRESS_LEVEL_CRITICAL && events != 0) {
|
} else if (level == VMPRESS_LEVEL_CRITICAL && events != 0) {
|
||||||
|
|
@ -3771,6 +3773,8 @@ static bool update_props() {
|
||||||
low_ram_device = property_get_bool("ro.config.low_ram", false);
|
low_ram_device = property_get_bool("ro.config.low_ram", false);
|
||||||
kill_timeout_ms =
|
kill_timeout_ms =
|
||||||
(unsigned long)GET_LMK_PROPERTY(int32, "kill_timeout_ms", 100);
|
(unsigned long)GET_LMK_PROPERTY(int32, "kill_timeout_ms", 100);
|
||||||
|
pressure_after_kill_min_score =
|
||||||
|
(unsigned long)GET_LMK_PROPERTY(int32, "pressure_after_kill_min_score", 0);
|
||||||
use_minfree_levels =
|
use_minfree_levels =
|
||||||
GET_LMK_PROPERTY(bool, "use_minfree_levels", false);
|
GET_LMK_PROPERTY(bool, "use_minfree_levels", false);
|
||||||
per_app_memcg =
|
per_app_memcg =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue