From 6434ba1b52cbe233c66f44800f0e18b32748dd62 Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Sun, 7 May 2023 10:33:04 -0700 Subject: [PATCH] simple_lmk: Ratelimit the 'no processes available to kill' message Under extreme simulated memory pressure, the 'no processes available to kill' message can be spammed hundreds of thousands of times, which is not productive. Ratelimit it. Signed-off-by: Sultan Alsawaf --- drivers/android/simple_lmk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/android/simple_lmk.c b/drivers/android/simple_lmk.c index 1200de5386b7..c9db1dfd3404 100644 --- a/drivers/android/simple_lmk.c +++ b/drivers/android/simple_lmk.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -193,7 +194,7 @@ static void scan_and_kill(void) /* Populate the victims array with tasks sorted by adj and then size */ pages_found = find_victims(&nr_found); if (unlikely(!nr_found)) { - pr_err("No processes available to kill!\n"); + pr_err_ratelimited("No processes available to kill!\n"); return; }