diff options
author | Oleg Nesterov <[email protected]> | 2016-08-02 14:03:19 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2016-08-02 17:31:41 -0400 |
commit | ef419398b68925f21fd3d8463c7bf6934d2ec926 (patch) | |
tree | 7e8d69e75acb73da297061a5201e20a0c634f207 | |
parent | db4ad0360c54a4e3bf07de9dfe429259ca8dc223 (diff) |
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 b95c35e76b29b ("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: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Oleg Nesterov <[email protected]>
Acked-by: David Rientjes <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Tetsuo Handa <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | fs/proc/base.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 31370da2ee7c..54e270262979 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -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; - read_lock(&tasklist_lock); - if (pid_alive(task)) - points = oom_badness(task, NULL, NULL, totalpages) * - 1000 / totalpages; - read_unlock(&tasklist_lock); + points = oom_badness(task, NULL, NULL, totalpages) * + 1000 / totalpages; seq_printf(m, "%lu\n", points); return 0; |