linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Rientjes <rientjes@google.com>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] proc_oom_score: remove tasklist_lock and pid_alive()
Date: Thu, 9 Jun 2016 08:44:56 +0200	[thread overview]
Message-ID: <20160609064455.GB24777@dhcp22.suse.cz> (raw)
In-Reply-To: <20160608211921.GA15508@redhat.com>

On Wed 08-06-16 23:19:21, Oleg Nesterov wrote:
> 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>

Acked-by: Michal Hocko <mhocko@suse.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
> 

-- 
Michal Hocko
SUSE Labs

      parent reply	other threads:[~2016-06-09  6:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-08 21:19 Oleg Nesterov
2016-06-08 22:48 ` David Rientjes
2016-06-09  6:44 ` Michal Hocko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160609064455.GB24777@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=rientjes@google.com \
    --subject='Re: [PATCH] proc_oom_score: remove tasklist_lock and pid_alive()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).