summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2018-05-15 03:25:22 +0000
committerDan Willemsen <dwillemsen@google.com>2018-05-15 03:26:05 +0000
commit0051684905e093c8c8ac5cc9f861392fea9d0b0c (patch)
treeb21eb49e802b8b774826c321a8360a5b0e081295
parent5e60f88cab8a22d88d76f7fd49f5a6e9cc0d931b (diff)
downloadcore-0051684905e093c8c8ac5cc9f861392fea9d0b0c.tar.gz
core-0051684905e093c8c8ac5cc9f861392fea9d0b0c.tar.bz2
core-0051684905e093c8c8ac5cc9f861392fea9d0b0c.zip
Revert "Only log the lmkd state change when the killing really happened."
This reverts commit 5e60f88cab8a22d88d76f7fd49f5a6e9cc0d931b. Reason for revert: broke some builds Bug: 78603347 Change-Id: I46bf6face35f5399d7d43146b360c0703eedfb1a
-rw-r--r--lmkd/lmkd.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/lmkd/lmkd.c b/lmkd/lmkd.c
index e74e2f6a5..20937cd77 100644
--- a/lmkd/lmkd.c
+++ b/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