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: <X8f5zQi+AzaY+ieY@mtj.duckdns.org>
Date:   Wed, 2 Dec 2020 15:32:13 -0500
From:   Tejun Heo <tj@...nel.org>
To:     Baolin Wang <baolin.wang@...ux.alibaba.com>
Cc:     axboe@...nel.dk, baolin.wang7@...il.com,
        linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] blk-iocost: Optimize the ioc_refreash_vrate()
 function

On Sun, Nov 29, 2020 at 10:37:18AM +0800, Baolin Wang wrote:
> The ioc_refreash_vrate() will only be called in ioc_timer_fn() after
> starting a new period or stopping the period.
> 
> So when starting a new period, the variable 'pleft' in ioc_refreash_vrate()
> is always the period's time, which means if the abs(ioc->vtime_err)
> is less than the period's time, the vcomp is 0, and we do not need
> compensate the vtime_rate in this case, just set it as the base vrate
> and return.
> 
> When stopping the period, the ioc->vtime_err will be cleared to 0,
> and we also do not need to compensate the vtime_rate, just set it as
> the base vrate and return.

Before, the function did something which is conceptually discrete and
describable. After, its operation is intertwined with when it's called. I
don't think this sort of micro optimizations are beneficial in cold paths.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ