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]
Date:   Tue, 7 Feb 2017 12:04:19 +0100
From:   Jan Kara <jack@...e.cz>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Jan Kara <jack@...e.cz>
Subject: Re: [PATCH] mm: Place "not" inside of unlikely() statement in
 wb_domain_writeout_inc()

On Mon 06-02-17 12:00:35, Steven Rostedt wrote:
> From: "Steven Rostedt (VMware)" <rostedt@...dmis.org>
> 
> The likely/unlikely profiler noticed that the unlikely statement in
> wb_domain_writeout_inc() is constantly wrong. This is due to the "not" (!)
> being outside the unlikely statement. It is likely that dom->period_time
> will be set, but unlikely that it wont be. Move the not into the unlikely
> statement.
> 
> Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.org>

Yeah, good catch. You can add:

Reviewed-by: Jan Kara <jack@...e.cz>

Andrew, will you merge this patch please? Thanks!

								Honza

> ---
>  mm/page-writeback.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> index 290e8b7..94102c7 100644
> --- a/mm/page-writeback.c
> +++ b/mm/page-writeback.c
> @@ -580,7 +580,7 @@ static void wb_domain_writeout_inc(struct wb_domain *dom,
>  	__fprop_inc_percpu_max(&dom->completions, completions,
>  			       max_prop_frac);
>  	/* First event after period switching was turned off? */
> -	if (!unlikely(dom->period_time)) {
> +	if (unlikely(!dom->period_time)) {
>  		/*
>  		 * We can race with other __bdi_writeout_inc calls here but
>  		 * it does not cause any harm since the resulting time when
> -- 
> 2.9.3
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ