Commit ef419398 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

proc_oom_score: remove tasklist_lock and pid_alive()

This was needed before to ensure that ->signal != 0 and do_each_thread()
is safe, see commit b95c35e7 ("oom: fix the unsafe usage of
badness() in proc_oom_score()") for details.

Today tsk->signal can't go away and for_each_thread(tsk) is always safe.

Link: default avatarOleg Nesterov <>
Acked-by: default avatarDavid Rientjes <>
Acked-by: default avatarMichal Hocko <>
Cc: Tetsuo Handa <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent db4ad036
......@@ -579,11 +579,8 @@ static int proc_oom_score(struct seq_file *m, struct pid_namespace *ns,
unsigned long totalpages = totalram_pages + total_swap_pages;
unsigned long points = 0;
if (pid_alive(task))
points = oom_badness(task, NULL, NULL, totalpages) *
1000 / totalpages;
points = oom_badness(task, NULL, NULL, totalpages) *
1000 / totalpages;
seq_printf(m, "%lu\n", points);
return 0;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment