All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kemeng Shi <shikemeng@huaweicloud.com>
To: paolo.valente@linaro.org, axboe@kernel.dk, jack@suse.cz
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	shikemeng@huaweicloud.com
Subject: [PATCH 07/17] block, bfq: correct interactive weight-raise check in bfq_set_budget_timeout
Date: Sun, 19 Feb 2023 18:42:59 +0800	[thread overview]
Message-ID: <20230219104309.1511562-8-shikemeng@huaweicloud.com> (raw)
In-Reply-To: <20230219104309.1511562-1-shikemeng@huaweicloud.com>

After weight-raise finished, bfqq->wr_coeff is reset to 1 while
bfqq->wr_cur_max_time may not be reset. For example,
Function bfq_update_bfqq_wr_on_rq_arrival will only reset wr_coeff to 1 if
bfqq is created in burst creation. Function bfq_set_budget_timeout will be
called when bfqq is selected while it's wr_cur_max_time is set and wr_coeff
is 1. Fix this by check wr_coeff > 1 along with check wr_cur_max_time
check like other code do.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
 block/bfq-iosched.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index b32bae5259d5..5610a7dcacdf 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -3297,7 +3297,8 @@ static void bfq_set_budget_timeout(struct bfq_data *bfqd,
 {
 	unsigned int timeout_coeff;
 
-	if (bfqq->wr_cur_max_time == bfqd->bfq_wr_rt_max_time)
+	if (bfqq->wr_coeff > 1 &&
+	    bfqq->wr_cur_max_time == bfqd->bfq_wr_rt_max_time)
 		timeout_coeff = 1;
 	else
 		timeout_coeff = bfqq->entity.weight / bfqq->entity.orig_weight;
-- 
2.30.0


  parent reply	other threads:[~2023-02-19  2:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-19 10:42 [PATCH 00/17] Some bugfix and cleanup patches for bfq Kemeng Shi
2023-02-19 10:42 ` [PATCH 01/17] block, bfq: properly mark bfqq remained idle Kemeng Shi
2023-02-19 10:42 ` [PATCH 02/17] block, bfq: try preemption if bfqq has higher weight and the same priority class Kemeng Shi
2023-02-19 10:42 ` [PATCH 03/17] block, bfq: only preempt plugged in_service_queue if bfq_better_to_idle say no Kemeng Shi
2023-02-19 10:42 ` [PATCH 04/17] block, bfq: recover the "service hole" if enough budget is left Kemeng Shi
2023-02-19 10:42 ` [PATCH 05/17] block, bfq: Update bfqd->max_budget with bfqd->lock held Kemeng Shi
2023-02-19 10:42 ` [PATCH 06/17] block, bfq: correct bfq_max_budget and bfq_min_budget Kemeng Shi
2023-02-19 10:42 ` Kemeng Shi [this message]
2023-02-19 10:43 ` [PATCH 08/17] block, bfq: start service_from_wr accumulating of async queues correctly Kemeng Shi
2023-02-19 10:43 ` [PATCH 09/17] block, bfq: stop to detect queue as waker queue if it already is now Kemeng Shi
2023-02-19 10:43 ` [PATCH 10/17] block, bfq: fix typo in comment Kemeng Shi
2023-02-19 10:43 ` [PATCH 11/17] block, bfq: simpfy computation of bfqd->budgets_assigned Kemeng Shi
2023-02-19 10:43 ` [PATCH 12/17] block, bfq: define and use soft_rt, in_burst and wr_or_deserves_wr only low_latency is enable Kemeng Shi
2023-02-19 10:43 ` [PATCH 13/17] block, bfq: remove unnecessary "wr" part of wr_or_deserves_wr Kemeng Shi
2023-02-19 10:43 ` [PATCH 14/17] block, bfq: remove redundant oom_bfqq check for bfqq from bfq_find_close_cooperator Kemeng Shi
2023-02-19 10:43 ` [PATCH 15/17] block, bfq: some cleanups for function bfq_pos_tree_add_move Kemeng Shi
2023-02-19 10:43 ` [PATCH 16/17] block, bfq: remove unnecessary goto tag in __bfq_weights_tree_remove Kemeng Shi
2023-02-19 10:43 ` [PATCH 17/17] block, bfq: remove unnecessary local variable __bfqq in bfq_setup_merge Kemeng Shi
2023-03-14  8:45   ` kernel test robot
2023-02-20  0:48 kernel test robot
2023-02-23  5:48 ` Dan Carpenter
2023-02-23  6:34 ` Kemeng Shi

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=20230219104309.1511562-8-shikemeng@huaweicloud.com \
    --to=shikemeng@huaweicloud.com \
    --cc=axboe@kernel.dk \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paolo.valente@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.