linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Chengming Zhou <zhouchengming@bytedance.com>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iocost: Only inc nr_shortages when have io waited
Date: Tue, 4 Aug 2020 10:24:09 -0400	[thread overview]
Message-ID: <20200804142409.GB4819@mtj.thefacebook.com> (raw)
In-Reply-To: <20200801170021.76756-1-zhouchengming@bytedance.com>

On Sun, Aug 02, 2020 at 01:00:21AM +0800, Chengming Zhou wrote:
> The last else branch of current code may have not io waited in iocg,
> in which case we should not inc nr_shortages, or the device vrate
> will speed up even this iocg is not shortage of vtime.
> 
> Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
> ---
>  block/blk-iocost.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/blk-iocost.c b/block/blk-iocost.c
> index 86ba6fd254e1..ce68b5749364 100644
> --- a/block/blk-iocost.c
> +++ b/block/blk-iocost.c
> @@ -1485,7 +1485,7 @@ static void ioc_timer_fn(struct timer_list *timer)
>  				__propagate_active_weight(iocg, iocg->weight,
>  							  new_inuse);
>  			}
> -		} else {
> +		} else if (waitqueue_active(&iocg->waitq)) {

This is intentional. Shortage doesn't necessarily mean that there are
waiters right now. If there are cgroups which don't have enough headroom to
donate and the device is hitting the latency targets, it makes sense to ramp
up vrate as those cgroups are likely to get throttled.

Thanks.

-- 
tejun

      reply	other threads:[~2020-08-04 14:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-01 17:00 [PATCH] iocost: Only inc nr_shortages when have io waited Chengming Zhou
2020-08-04 14:24 ` Tejun Heo [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=20200804142409.GB4819@mtj.thefacebook.com \
    --to=tj@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zhouchengming@bytedance.com \
    /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).