From fc6b78b37602a1636e3181aeebf8199336ea25ea Mon Sep 17 00:00:00 2001 From: Srinivasarao P Date: Wed, 22 Sep 2021 18:38:34 +0530 Subject: [PATCH] mm: reap tasks that are killed by prekill Reap tasks that are killed by PreKillActionT. Change-Id: I367e803848121d071d8143952eaa9b7195ae04d6 Signed-off-by: Srinivasarao P --- include/linux/oom.h | 1 + kernel/signal.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/oom.h b/include/linux/oom.h index c42064f074cf..dd0ff7096f86 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h @@ -136,4 +136,5 @@ extern int sysctl_reap_mem_on_sigkill; extern void add_to_oom_reaper(struct task_struct *p); extern void check_panic_on_foreground_kill(struct task_struct *p); #define ULMK_MAGIC "lmkd" +#define PRE_KILL "PreKillActionT" #endif /* _INCLUDE_LINUX_OOM_H */ diff --git a/kernel/signal.c b/kernel/signal.c index 31a478a16295..4a936e403430 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1416,7 +1416,8 @@ int group_send_sig_info(int sig, struct kernel_siginfo *info, check_panic_on_foreground_kill(p); ret = do_send_sig_info(sig, info, p, type); if (capable(CAP_KILL) && sig == SIGKILL) - if (!strcmp(current->comm, ULMK_MAGIC)) + if (!strcmp(current->comm, ULMK_MAGIC) || + !strcmp(current->comm, PRE_KILL)) add_to_oom_reaper(p); }