From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758505AbcFHVT1 (ORCPT ); Wed, 8 Jun 2016 17:19:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39254 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758489AbcFHVTY (ORCPT ); Wed, 8 Jun 2016 17:19:24 -0400 Date: Wed, 8 Jun 2016 23:19:21 +0200 From: Oleg Nesterov To: Andrew Morton Cc: David Rientjes , Michal Hocko , Tetsuo Handa , linux-kernel@vger.kernel.org Subject: [PATCH] proc_oom_score: remove tasklist_lock and pid_alive() Message-ID: <20160608211921.GA15508@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 08 Jun 2016 21:19:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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