linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Tejun Heo <tj@kernel.org>
Cc: axboe@kernel.dk, baolin.wang7@gmail.com,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] blk-iocost: Optimize the ioc_refreash_vrate() function
Date: Fri, 4 Dec 2020 11:36:19 +0800	[thread overview]
Message-ID: <9d1098dc-f716-872b-ea63-aea4a44355dc@linux.alibaba.com> (raw)
In-Reply-To: <X8f5zQi+AzaY+ieY@mtj.duckdns.org>



在 2020/12/3 4:32, Tejun Heo 写道:
> 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.

OK. I understood your concern. Thanks for your input.

      reply	other threads:[~2020-12-04  3:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-29  2:37 [RFC PATCH] blk-iocost: Optimize the ioc_refreash_vrate() function Baolin Wang
2020-12-02 20:32 ` Tejun Heo
2020-12-04  3:36   ` Baolin Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d1098dc-f716-872b-ea63-aea4a44355dc@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=axboe@kernel.dk \
    --cc=baolin.wang7@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).