From: Kemeng Shi <shikemeng@huawei.com>
To: <paolo.valente@linaro.org>, <axboe@kernel.dk>
Cc: <linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<shikemeng@huawei.com>
Subject: [PATCH 01/10] block, bfq: correctly raise inject limit in bfq_choose_bfqq_for_injection
Date: Tue, 8 Nov 2022 12:52:15 +0800 [thread overview]
Message-ID: <20221108045224.19092-2-shikemeng@huawei.com> (raw)
In-Reply-To: <20221108045224.19092-1-shikemeng@huawei.com>
Inject limit could be temporarily raised if current inject_limit is 0.
raised limit is saved in local variable "limit". The traverse below will
reset raised "limit" to bfqd->in_service_queue which is 0 for limit
raised condition and will invalidate the raised limit.
After passing bfqd->rq_in_driver >= limit check above, we can be sure
about two things in traverse:
1. Local variable "limit" is greater than 0 or bfqd->rq_in_driver >= limit
check is always met.
2. For normal case (else case for large request to non-rotational drives),
no need to check bfqd->rq_in_driver < limit again if local variable
"limit" is not changed.
Fix this by not overwriting local variable "limit" in traverse. As
metioned in first thing above that limit is greater than 0, so result of
min_t(unsigned int, 1, limit) is always 1. we can simply check whether
rq_in_driver is less than 1 for case of large request to non-rotational
drives and remove assignment to local variable "limit" in traverse. As
metioned in second thing above, in normal case no futher check is needed
if local variable "limit" is not chaged, so return directly in normal
case.
Signed-off-by: Kemeng Shi <shikemeng@huawei.com>
---
block/bfq-iosched.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 7ea427817f7f..b0bee8ab65e6 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -4707,12 +4707,10 @@ bfq_choose_bfqq_for_injection(struct bfq_data *bfqd)
*/
if (blk_queue_nonrot(bfqd->queue) &&
blk_rq_sectors(bfqq->next_rq) >=
- BFQQ_SECT_THR_NONROT)
- limit = min_t(unsigned int, 1, limit);
- else
- limit = in_serv_bfqq->inject_limit;
-
- if (bfqd->rq_in_driver < limit) {
+ BFQQ_SECT_THR_NONROT &&
+ bfqd->rq_in_driver >= 1)
+ continue;
+ else {
bfqd->rqs_injected = true;
return bfqq;
}
--
2.30.0
next prev parent reply other threads:[~2022-11-08 4:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 4:52 [PATCH 00/10] A few bugfix and cleancode patch for bfq Kemeng Shi
2022-11-08 4:52 ` Kemeng Shi [this message]
2022-11-08 4:52 ` [PATCH 02/10] block, bfq: remove unsed parameter reason in bfq_bfqq_is_slow Kemeng Shi
2022-11-08 4:52 ` [PATCH 03/10] block, bfq: initialize bfqq->decrease_time_jif correctly Kemeng Shi
2022-11-08 4:52 ` [PATCH 04/10] block, bfq: use helper macro RQ_BFQQ to get bfqq of request Kemeng Shi
2022-11-08 4:52 ` [PATCH 05/10] block, bfq: remove unnecessary pointer reference to get async_bfqq Kemeng Shi
2022-11-08 4:52 ` [PATCH 06/10] block, bfq: remove redundant bfqd->rq_in_driver > 0 check in bfq_add_request Kemeng Shi
2022-11-08 4:52 ` [PATCH 07/10] block, bfq: remove redundant check in bfq_put_cooperator Kemeng Shi
2022-11-08 4:52 ` [PATCH 08/10] block, bfq: remove unnecessary goto tag in bfq_dispatch_rq_from_bfqq Kemeng Shi
2022-11-08 4:52 ` [PATCH 09/10] block, bfq: remove unused bfq_wr_max_time in struct bfq_data Kemeng Shi
2022-11-08 4:52 ` [PATCH 10/10] block, bfq: remove check of bfq_wr_max_softrt_rate which is always greater than 0 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=20221108045224.19092-2-shikemeng@huawei.com \
--to=shikemeng@huawei.com \
--cc=axboe@kernel.dk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®