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@xxxxxxxxxxxxxxx> --- 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 eda6669d0571..6a8ea9a451cc 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -1656,12 +1656,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; @@ -1873,7 +1873,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; bool bfqq_non_merged_or_stably_merged = bfqq->bic || RQ_BIC(rq)->bfqq_data[act_idx].stably_merged; @@ -1916,14 +1916,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_non_merged_or_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