lmkd: fix low swap threshold failing to update after reinit am: 6e6d14b387 am: 07de899509 am: 6d2d6d4d62
Original change: https://android-review.googlesource.com/c/platform/system/memory/lmkd/+/1874517 Change-Id: I5efeb150d303d81fbd3575171bb6cef40a278505
This commit is contained in:
commit
ac36e3a50a
8
lmkd.cpp
8
lmkd.cpp
|
|
@ -2428,7 +2428,6 @@ static void mp_event_psi(int data, uint32_t events, struct polling_params *poll_
|
||||||
static int64_t base_file_lru;
|
static int64_t base_file_lru;
|
||||||
static int64_t init_pgscan_kswapd;
|
static int64_t init_pgscan_kswapd;
|
||||||
static int64_t init_pgscan_direct;
|
static int64_t init_pgscan_direct;
|
||||||
static int64_t swap_low_threshold;
|
|
||||||
static bool killing;
|
static bool killing;
|
||||||
static int thrashing_limit = thrashing_limit_pct;
|
static int thrashing_limit = thrashing_limit_pct;
|
||||||
static struct zone_watermarks watermarks;
|
static struct zone_watermarks watermarks;
|
||||||
|
|
@ -2453,6 +2452,7 @@ static void mp_event_psi(int data, uint32_t events, struct polling_params *poll_
|
||||||
bool cut_thrashing_limit = false;
|
bool cut_thrashing_limit = false;
|
||||||
int min_score_adj = 0;
|
int min_score_adj = 0;
|
||||||
int swap_util = 0;
|
int swap_util = 0;
|
||||||
|
int64_t swap_low_threshold;
|
||||||
long since_thrashing_reset_ms;
|
long since_thrashing_reset_ms;
|
||||||
int64_t workingset_refault_file;
|
int64_t workingset_refault_file;
|
||||||
|
|
||||||
|
|
@ -2501,10 +2501,10 @@ static void mp_event_psi(int data, uint32_t events, struct polling_params *poll_
|
||||||
|
|
||||||
/* Check free swap levels */
|
/* Check free swap levels */
|
||||||
if (swap_free_low_percentage) {
|
if (swap_free_low_percentage) {
|
||||||
if (!swap_low_threshold) {
|
swap_low_threshold = mi.field.total_swap * swap_free_low_percentage / 100;
|
||||||
swap_low_threshold = mi.field.total_swap * swap_free_low_percentage / 100;
|
|
||||||
}
|
|
||||||
swap_is_low = mi.field.free_swap < swap_low_threshold;
|
swap_is_low = mi.field.free_swap < swap_low_threshold;
|
||||||
|
} else {
|
||||||
|
swap_low_threshold = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Identify reclaim state */
|
/* Identify reclaim state */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue