Merge "mm: oom_kill: reap memory of a task that receives SIGKILL"

This commit is contained in:
qctecmdr 2019-12-17 16:36:53 -08:00 • committed by Gerrit - the friendly Code Review server
commit 4296d43619
5 changed files with 74 additions and 9 deletions

View file

@ -46,6 +46,7 @@
#include <linux/livepatch.h>
#include <linux/cgroup.h>
#include <linux/audit.h>
#include <linux/oom.h>
#define CREATE_TRACE_POINTS
#include <trace/events/signal.h>
@ -1404,8 +1405,11 @@ int group_send_sig_info(int sig, struct kernel_siginfo *info,
ret = check_kill_permission(sig, info, p);
rcu_read_unlock();
if (!ret && sig)
if (!ret && sig) {
ret = do_send_sig_info(sig, info, p, type);
if (capable(CAP_KILL) && sig == SIGKILL)
add_to_oom_reaper(p);
}
return ret;
}