linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] proc_oom_score: remove tasklist_lock and pid_alive()
@ 2016-06-08 21:19 Oleg Nesterov
  2016-06-08 22:48 ` David Rientjes
  2016-06-09  6:44 ` Michal Hocko
  0 siblings, 2 replies; 3+ messages in thread
From: Oleg Nesterov @ 2016-06-08 21:19 UTC (permalink / raw)
  To: Andrew Morton; +Cc: David Rientjes, Michal Hocko, Tetsuo Handa, linux-kernel

This was needed before to ensure that ->signal != 0 and do_each_thread()
is safe, see the commit b95c35e76b29b for details.

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

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 fs/proc/base.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index a11eb71..93e7754 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;
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-09  6:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-08 21:19 [PATCH] proc_oom_score: remove tasklist_lock and pid_alive() Oleg Nesterov
2016-06-08 22:48 ` David Rientjes
2016-06-09  6:44 ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).