[4/4] mm, oom: Respect oom_task_origin() even if oom_kill_allocating_task case.
diff mbox series

Message ID 1558519686-16057-4-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp
State New
Headers show
Series
  • [1/4] mm, oom: Remove redundant OOM score normalization at select_bad_process().
Related show

Commit Message

Tetsuo Handa May 22, 2019, 10:08 a.m. UTC
Currently oom_kill_allocating_task path ignores oom_task_origin() tasks.
But since oom_task_origin() is used for "notify me first using SIGKILL
(because I'm likely the culprit for this situation)", respect it.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
 mm/oom_kill.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 64e582e..bdd90b5 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -380,7 +380,8 @@  static const char *select_bad_process(struct oom_control *oc)
 		if (oom_evaluate_task(p, oc))
 			break;
 	rcu_read_unlock();
-	if (sysctl_oom_kill_allocating_task && oc->chosen != (void *)-1UL) {
+	if (sysctl_oom_kill_allocating_task && oc->chosen != (void *)-1UL &&
+	    oc->chosen_points != ULONG_MAX) {
 		list_for_each_entry(p, &oom_candidate_list,
 				    oom_candidate_list) {
 			if (!same_thread_group(p, current))