From 0431b65e6c5c2dbc838d91e9fa9af515c85b9f14 Mon Sep 17 00:00:00 2001 From: Suren Baghdasaryan Date: Fri, 14 Oct 2022 19:11:22 +0000 Subject: [PATCH] lmkd: prevent the main thread from reaping synchronously lmkd main thread is running at RT priority to prevent it from being blocked by other processes. However when all reaper threads are busy, lmkd will kill and reap the memory of the target process from the context of the main thread and that can cause two issues: 1. lmkd main thread gets blocked for considerable duration. 2. lmkd main and reaper threads might monopolize CPUs. To prevent these issues, when all reaper threads are busy, lmkd will send a SIGKILL but will not synchronously reap the memory of the target process. Bug: 238495258 Signed-off-by: Suren Baghdasaryan Change-Id: I351c01229152946969e646b538a2494656c0cc85 Merged-In: I351c01229152946969e646b538a2494656c0cc85 --- reaper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reaper.cpp b/reaper.cpp index bf6bafc..7635b24 100644 --- a/reaper.cpp +++ b/reaper.cpp @@ -235,7 +235,7 @@ int Reaper::kill(const struct target_proc& target, bool synchronous) { return result; } - return is_reaping_supported() ? process_mrelease(target.pidfd, 0) : 0; + return 0; } Reaper::target_proc Reaper::dequeue_request() {