Revert "Only log the lmkd state change when the killing really happened."
This reverts commit 5e60f88cab
.
Reason for revert: broke some builds
Bug: 78603347
Change-Id: I46bf6face35f5399d7d43146b360c0703eedfb1a
This commit is contained in:
parent
5e60f88cab
commit
0051684905
1 changed files with 5 additions and 10 deletions
15
lmkd/lmkd.c
15
lmkd/lmkd.c
|
@ -1026,7 +1026,9 @@ static int find_and_kill_processes(enum vmpressure_level level,
|
|||
int pages_freed = 0;
|
||||
|
||||
#ifdef LMKD_LOG_STATS
|
||||
bool lmk_state_change_start = false;
|
||||
if (enable_stats_log) {
|
||||
stats_write_lmk_state_changed(log_ctx, LMK_STATE_CHANGED, LMK_STATE_CHANGE_START);
|
||||
}
|
||||
#endif
|
||||
|
||||
for (i = OOM_SCORE_ADJ_MAX; i >= min_score_adj; i--) {
|
||||
|
@ -1041,18 +1043,11 @@ static int find_and_kill_processes(enum vmpressure_level level,
|
|||
|
||||
killed_size = kill_one_process(procp, min_score_adj, level);
|
||||
if (killed_size >= 0) {
|
||||
#ifdef LMKD_LOG_STATS
|
||||
if (enable_stats_log && !lmk_state_change_start) {
|
||||
lmk_state_change_start = true;
|
||||
stats_write_lmk_state_changed(log_ctx, LMK_STATE_CHANGED, FIRST_KILLING_DONE);
|
||||
}
|
||||
#endif
|
||||
|
||||
pages_freed += killed_size;
|
||||
if (pages_freed >= pages_to_free) {
|
||||
|
||||
#ifdef LMKD_LOG_STATS
|
||||
if (enable_stats_log && lmk_state_change_start) {
|
||||
if (enable_stats_log) {
|
||||
stats_write_lmk_state_changed(log_ctx, LMK_STATE_CHANGED,
|
||||
LMK_STATE_CHANGE_STOP);
|
||||
}
|
||||
|
@ -1064,7 +1059,7 @@ static int find_and_kill_processes(enum vmpressure_level level,
|
|||
}
|
||||
|
||||
#ifdef LMKD_LOG_STATS
|
||||
if (enable_stats_log && lmk_state_change_start) {
|
||||
if (enable_stats_log) {
|
||||
stats_write_lmk_state_changed(log_ctx, LMK_STATE_CHANGED, LMK_STATE_CHANGE_STOP);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue