Skip to content

Commit e61e002

Browse files
YuKuai-huaweiaxboe
authored andcommitted
block, bfq: remove local variable 'split' in bfq_init_rq()
The local variable is used to call bfq_bfqq_resume_state() later, since 'bfqd->lock' is held, and bfqq status will not change between setting 'split' and calling bfq_bfqq_resume_state(), move forward bfq_bfqq_resume_state() so that 'split' can be removed. There are no functional chagnes. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 553a606 commit e61e002

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

block/bfq-iosched.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6877,7 +6877,7 @@ static struct bfq_queue *bfq_init_rq(struct request *rq)
68776877
const int is_sync = rq_is_sync(rq);
68786878
struct bfq_queue *bfqq;
68796879
bool new_queue = false;
6880-
bool bfqq_already_existing = false, split = false;
6880+
bool bfqq_already_existing = false;
68816881
unsigned int a_idx = bfq_actuator_index(bfqd, bio);
68826882

68836883
if (unlikely(!rq->elv.icq))
@@ -6914,16 +6914,19 @@ static struct bfq_queue *bfq_init_rq(struct request *rq)
69146914
true;
69156915

69166916
bfqq = bfq_split_bfqq(bic, bfqq);
6917-
split = true;
6918-
69196917
if (!bfqq) {
69206918
bfqq = bfq_get_bfqq_handle_split(bfqd, bic, bio,
69216919
true, is_sync,
69226920
NULL);
69236921
if (unlikely(bfqq == &bfqd->oom_bfqq))
69246922
bfqq_already_existing = true;
6925-
} else
6923+
else
6924+
bfq_bfqq_resume_state(bfqq, bfqd, bic,
6925+
false);
6926+
} else {
69266927
bfqq_already_existing = true;
6928+
bfq_bfqq_resume_state(bfqq, bfqd, bic, true);
6929+
}
69276930

69286931
if (!bfqq_already_existing) {
69296932
bfqq->waker_bfqq = waker_bfqq;
@@ -6959,18 +6962,8 @@ static struct bfq_queue *bfq_init_rq(struct request *rq)
69596962
* resume its state.
69606963
*/
69616964
if (likely(bfqq != &bfqd->oom_bfqq) && !bfqq->new_bfqq &&
6962-
bfqq_process_refs(bfqq) == 1) {
6965+
bfqq_process_refs(bfqq) == 1)
69636966
bfqq->bic = bic;
6964-
if (split) {
6965-
/*
6966-
* The queue has just been split from a shared
6967-
* queue: restore the idle window and the
6968-
* possible weight raising period.
6969-
*/
6970-
bfq_bfqq_resume_state(bfqq, bfqd, bic,
6971-
bfqq_already_existing);
6972-
}
6973-
}
69746967

69756968
/*
69766969
* Consider bfqq as possibly belonging to a burst of newly

0 commit comments

Comments
 (0)