mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-14 17:53:39 +00:00
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/20160608211921.GA15508@redhat.com Signed-off-by: Oleg Nesterov <oleg@redhat.com> Acked-by: David Rientjes <rientjes@google.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
db4ad0360c
commit
ef419398b6
@ -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 totalpages = totalram_pages + total_swap_pages;
|
||||||
unsigned long points = 0;
|
unsigned long points = 0;
|
||||||
|
|
||||||
read_lock(&tasklist_lock);
|
points = oom_badness(task, NULL, NULL, totalpages) *
|
||||||
if (pid_alive(task))
|
1000 / totalpages;
|
||||||
points = oom_badness(task, NULL, NULL, totalpages) *
|
|
||||||
1000 / totalpages;
|
|
||||||
read_unlock(&tasklist_lock);
|
|
||||||
seq_printf(m, "%lu\n", points);
|
seq_printf(m, "%lu\n", points);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user