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: <20171128094025.fcnsmafbsp7cjkf6@techsingularity.net>
Date:   Tue, 28 Nov 2017 09:40:25 +0000
From:   Mel Gorman <mgorman@...hsingularity.net>
To:     Jiang Biao <jiang.biao2@....com.cn>
Cc:     akpm@...ux-foundation.org, mhocko@...e.com, hannes@...xchg.org,
        hillf.zj@...baba-inc.com, minchan@...nel.org, ying.huang@...el.com,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        zhong.weidong@....com.cn
Subject: Re: [PATCH] mm/vmscan: try to optimize branch procedures.

On Tue, Nov 28, 2017 at 09:49:45AM +0800, Jiang Biao wrote:
> 1. Use unlikely to try to improve branch prediction. The
> *total_scan < 0* branch is unlikely to reach, so use unlikely.
> 
> 2. Optimize *next_deferred >= scanned* condition.
> *next_deferred >= scanned* condition could be optimized into
> *next_deferred > scanned*, because when *next_deferred == scanned*,
> next_deferred shoud be 0, which is covered by the else branch.
> 
> 3. Merge two branch blocks into one. The *next_deferred > 0* branch
> could be merged into *next_deferred > scanned* to simplify the code.
> 
> Signed-off-by: Jiang Biao <jiang.biao2@....com.cn>

These are slow paths. Do you have perf data indicating the branches are
frequently mispredicted? Do you have data showing this improves
performance?

-- 
Mel Gorman
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ