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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170106101653.orsf6ahgexc4etmx@techsingularity.net>
Date:   Fri, 6 Jan 2017 10:16:53 +0000
From:   Mel Gorman <mgorman@...hsingularity.net>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Dirk Hohndel <dirkhh@...are.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Jesper Dangaard Brouer <brouer@...hat.com>
Subject: Re: mm, page_alloc: Swap likely to unlikely as code logic is
 different for next_zones_zonelist()

On Thu, Jan 05, 2017 at 08:01:02PM -0500, Steven Rostedt wrote:
> Commit 682a3385e773 "mm, page_alloc: inline the fast path of the
> zonelist iterator" changed how next_zones_zonelist() is called, by
> adding a static inline function to do the fast path. This function adds:
> 
>        if (likely(!nodes && zonelist_zone_idx(z) <= highest_zoneidx))
>                return z;
>        return __next_zones_zonelist(z, highest_zoneidx, nodes);
> 
> Where __next_zones_zonelist() is only called when nodes is not NULL or
> zonelist_zone_idx(z) is less than highest_zoneidx.
> 
> The original next_zone_zonelist() was converted to
> __next_zones_zonelist() but it still maintained:
> 
> 	if (likely(nodes == NULL))
> 
> Which is now actually a very unlikely, as it is only called with nodes
> equal to NULL when zonelist_zone_idx(z) is greater than highest_zoneidx.
> 
> Before this commit, this if had this statistic:
> 
>  correct incorrect  %        Function                  File              Line
>  ------- ---------  -        --------                  ----              ----
>   837895   446078  34 next_zones_zonelist            mmzone.c             63
> 
> After this commit, it has:
> 
>  correct incorrect  %        Function                  File              Line
>  ------- ---------  -        --------                  ----              ----
>       10   173840  99 __next_zones_zonelist          mmzone.c             63
> 
> Thus, the if statement is now much more unlikely than it ever was as a
> likely.
> 
> Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.org>

Well spotted;

Acked-by: Mel Gorman <mgorman@...hsingularity.net>

-- 
Mel Gorman
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ