2022-11-08 05:44:25

by Kemeng Shi

[permalink] [raw]
Subject: [PATCH 00/10] A few bugfix and cleancode patch for bfq

Hi, this is another series contain some bugfix and cleancode patches to
fix temporarily inject limit raise in bfq_choose_bfqq_for_injection,
correctly initialize decrease_time_jif to trigger inject limit update
in time and some random cleancode.
Thanks!

Kemeng Shi (10):
block, bfq: correctly raise inject limit in
bfq_choose_bfqq_for_injection
block, bfq: remove unsed parameter reason in bfq_bfqq_is_slow
block, bfq: initialize bfqq->decrease_time_jif correctly
block, bfq: use helper macro RQ_BFQQ to get bfqq of request
block, bfq: remove unnecessary pointer reference to get async_bfqq
block, bfq: remove redundant bfqd->rq_in_driver > 0 check in
bfq_add_request
block, bfq: remove redundant check in bfq_put_cooperator
block, bfq: remove unnecessary goto tag in bfq_dispatch_rq_from_bfqq
block, bfq: remove unused bfq_wr_max_time in struct bfq_data
block, bfq: remove check of bfq_wr_max_softrt_rate which is always
greater than 0

block/bfq-iosched.c | 49 +++++++++++++++++----------------------------
block/bfq-iosched.h | 2 --
2 files changed, 18 insertions(+), 33 deletions(-)

--
2.30.0



2022-11-08 05:44:25

by Kemeng Shi

[permalink] [raw]
Subject: [PATCH 10/10] block, bfq: remove check of bfq_wr_max_softrt_rate which is always greater than 0

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 <[email protected]>
---
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 40ac219b2d8f..d0a867b2569b 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -1840,8 +1840,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 &&
@@ -4350,8 +4349,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


2022-11-08 05:47:13

by Kemeng Shi

[permalink] [raw]
Subject: [PATCH 05/10] block, bfq: remove unnecessary pointer reference to get async_bfqq

The async_bfqq is assigned with bfqq->bic->bfqq[0], use it directly.

Signed-off-by: Kemeng Shi <[email protected]>
---
block/bfq-iosched.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 2c4fe286ead7..aad88ca5e5a5 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -4901,7 +4901,7 @@ static struct bfq_queue *bfq_select_queue(struct bfq_data *bfqd)
icq_to_bic(async_bfqq->next_rq->elv.icq) == bfqq->bic &&
bfq_serv_to_charge(async_bfqq->next_rq, async_bfqq) <=
bfq_bfqq_budget_left(async_bfqq))
- bfqq = bfqq->bic->bfqq[0];
+ bfqq = async_bfqq;
else if (bfqq->waker_bfqq &&
bfq_bfqq_busy(bfqq->waker_bfqq) &&
bfqq->waker_bfqq->next_rq &&
--
2.30.0