Linux block layer
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: paolo.valente@linaro.org, axboe@kernel.dk,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	jack@suse.cz, hch@lst.de, damien.lemoal@wdc.com
Subject: Re: [PATCH RESEND v2 10/10] block, bfq: remove check of bfq_wr_max_softrt_rate which is always greater than 0
Date: Mon, 2 Jan 2023 17:05:05 +0100	[thread overview]
Message-ID: <20230102160505.2r26ct5wadfhyr23@quack3> (raw)
In-Reply-To: <20221222191641.1643117-11-shikemeng@huaweicloud.com>

On Fri 23-12-22 03:16:41, Kemeng Shi wrote:
> bfqd->bfq_wr_max_softrt_rate is assigned with 7000 in bfq_init_queue and
> never changed. So we can remove bfqd->bfq_wr_max_softrt_rate > 0 check
> which is always true.
> 
> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>

I would just leave these checks for documentation purposes and for possible
experiments (e.g. disabling this logic by setting bfq_wr_max_softrt_rate to
0). Alternatively, we could just define a constant for this and
then we can remove all the checks, that would be a clean solution as well.

								Honza

> ---
>  block/bfq-iosched.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
> index 91bc68fba72d..00cdd42ac02a 100644
> --- a/block/bfq-iosched.c
> +++ b/block/bfq-iosched.c
> @@ -1788,8 +1788,7 @@ static void bfq_bfqq_handle_idle_busy_switch(struct bfq_data *bfqd,
>  	 *   to control its weight explicitly)
>  	 */
>  	in_burst = bfq_bfqq_in_large_burst(bfqq);
> -	soft_rt = bfqd->bfq_wr_max_softrt_rate > 0 &&
> -		!BFQQ_TOTALLY_SEEKY(bfqq) &&
> +	soft_rt = !BFQQ_TOTALLY_SEEKY(bfqq) &&
>  		!in_burst &&
>  		time_is_before_jiffies(bfqq->soft_rt_next_start) &&
>  		bfqq->dispatched == 0 &&
> @@ -4284,8 +4283,7 @@ void bfq_bfqq_expire(struct bfq_data *bfqd,
>  	if (bfqd->low_latency && bfqq->wr_coeff == 1)
>  		bfqq->last_wr_start_finish = jiffies;
>  
> -	if (bfqd->low_latency && bfqd->bfq_wr_max_softrt_rate > 0 &&
> -	    RB_EMPTY_ROOT(&bfqq->sort_list)) {
> +	if (bfqd->low_latency && RB_EMPTY_ROOT(&bfqq->sort_list)) {
>  		/*
>  		 * If we get here, and there are no outstanding
>  		 * requests, then the request pattern is isochronous
> -- 
> 2.30.0
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      reply	other threads:[~2023-01-02 16:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22 19:16 [PATCH RESEND v2 00/10] A few bugfix and cleancode patch for bfq Kemeng Shi
2022-12-22 19:16 ` [PATCH RESEND v2 01/10] block, bfq: correctly raise inject limit in bfq_choose_bfqq_for_injection Kemeng Shi
2023-01-02 15:13   ` Jan Kara
2022-12-22 19:16 ` [PATCH RESEND v2 02/10] block, bfq: remove unsed parameter reason in bfq_bfqq_is_slow Kemeng Shi
2023-01-02 15:14   ` Jan Kara
2022-12-22 19:16 ` [PATCH RESEND v2 03/10] block, bfq: initialize bfqq->decrease_time_jif correctly Kemeng Shi
2023-01-02 15:30   ` Jan Kara
2022-12-22 19:16 ` [PATCH RESEND v2 04/10] block, bfq: use helper macro RQ_BFQQ to get bfqq of request Kemeng Shi
2023-01-02 15:31   ` Jan Kara
2022-12-22 19:16 ` [PATCH RESEND v2 05/10] block, bfq: remove unnecessary dereference to get async_bfqq Kemeng Shi
2023-01-02 15:34   ` Jan Kara
2022-12-22 19:16 ` [PATCH RESEND v2 06/10] block, bfq: remove redundant bfqd->rq_in_driver > 0 check in bfq_add_request Kemeng Shi
2023-01-02 15:54   ` Jan Kara
2022-12-22 19:16 ` [PATCH RESEND v2 07/10] block, bfq: remove redundant check in bfq_put_cooperator Kemeng Shi
2023-01-02 15:57   ` Jan Kara
2022-12-22 19:16 ` [PATCH RESEND v2 08/10] block, bfq: remove unnecessary goto tag in bfq_dispatch_rq_from_bfqq Kemeng Shi
2023-01-02 15:59   ` Jan Kara
2022-12-22 19:16 ` [PATCH RESEND v2 09/10] block, bfq: remove unused bfq_wr_max_time in struct bfq_data Kemeng Shi
2023-01-02 16:00   ` Jan Kara
2022-12-22 19:16 ` [PATCH RESEND v2 10/10] block, bfq: remove check of bfq_wr_max_softrt_rate which is always greater than 0 Kemeng Shi
2023-01-02 16:05   ` Jan Kara [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=20230102160505.2r26ct5wadfhyr23@quack3 \
    --to=jack@suse.cz \
    --cc=axboe@kernel.dk \
    --cc=damien.lemoal@wdc.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paolo.valente@linaro.org \
    --cc=shikemeng@huaweicloud.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