lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160609064455.GB24777@dhcp22.suse.cz>
Date:	Thu, 9 Jun 2016 08:44:56 +0200
From:	Michal Hocko <mhocko@...nel.org>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	David Rientjes <rientjes@...gle.com>,
	Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] proc_oom_score: remove tasklist_lock and pid_alive()

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@...hat.com>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ