Before commit 96a291c38c3299 ("block, bfq: preempt lower-weight or lower-priority queues"), wr_or_deserves_wr is used to check if preempt is wanted. Currently, wr_or_deserves_wr is only used in bfq_update_bfqq_wr_on_rq_arrival to check if weight raising is needed, so the "wr" part of wr_or_deserves_wr is not needed anymore. Rename wr_or_deserves_wr to deserves_wr and remove unnecessary bfqq->wr_coeff > 1 for original wr_or_deserves_wr. Signed-off-by: Kemeng Shi <shikemeng@xxxxxxxxxx> --- block/bfq-iosched.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 0ecb3640d715..261ba2d63925 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -1681,12 +1681,12 @@ static unsigned long bfq_smallest_from_now(void) static void bfq_update_bfqq_wr_on_rq_arrival(struct bfq_data *bfqd, struct bfq_queue *bfqq, unsigned int old_wr_coeff, - bool wr_or_deserves_wr, + bool deserves_wr, bool interactive, bool in_burst, bool soft_rt) { - if (old_wr_coeff == 1 && wr_or_deserves_wr) { + if (old_wr_coeff == 1 && deserves_wr) { /* start a weight-raising period */ if (interactive) { bfqq->service_from_wr = 0; @@ -1866,7 +1866,7 @@ static void bfq_bfqq_handle_idle_busy_switch(struct bfq_data *bfqd, bfq_clear_bfqq_just_created(bfqq); if (bfqd->low_latency) { - bool soft_rt, in_burst, wr_or_deserves_wr; + bool soft_rt, in_burst, deserves_wr; /* * bfqq deserves to be weight-raised if: * - it is sync, @@ -1905,14 +1905,13 @@ static void bfq_bfqq_handle_idle_busy_switch(struct bfq_data *bfqd, * processes. So let also stably-merged queued enjoy weight * raising. */ - wr_or_deserves_wr = (bfqq->wr_coeff > 1 || - (bfq_bfqq_sync(bfqq) && + deserves_wr = (bfq_bfqq_sync(bfqq) && (bfqq->bic || RQ_BIC(rq)->stably_merged) && - (*interactive || soft_rt))); + (*interactive || soft_rt)); bfq_update_bfqq_wr_on_rq_arrival(bfqd, bfqq, old_wr_coeff, - wr_or_deserves_wr, + deserves_wr, *interactive, in_burst, soft_rt); -- 2.30.0