summaryrefslogtreecommitdiff
path: root/block/bfq-iosched.c
diff options
context:
space:
mode:
authorYu Kuai <yukuai3@huawei.com>2024-09-09 16:41:52 +0300
committerJens Axboe <axboe@kernel.dk>2024-09-11 01:32:09 +0300
commite61e002a67da9ec36571af743c94a968cf1ce116 (patch)
treee129debcce8183a829eb28a8e72a1fded80683fa /block/bfq-iosched.c
parent553a606c25f8ff5c518c7fcf488dd4dd5fbb4795 (diff)
downloadlinux-e61e002a67da9ec36571af743c94a968cf1ce116.tar.xz
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 <yukuai3@huawei.com> Link: https://lore.kernel.org/r/20240909134154.954924-6-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bfq-iosched.c')
-rw-r--r--block/bfq-iosched.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 17b0bf6b56bb..54f6eae2763d 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -6877,7 +6877,7 @@ static struct bfq_queue *bfq_init_rq(struct request *rq)
const int is_sync = rq_is_sync(rq);
struct bfq_queue *bfqq;
bool new_queue = false;
- bool bfqq_already_existing = false, split = false;
+ bool bfqq_already_existing = false;
unsigned int a_idx = bfq_actuator_index(bfqd, bio);
if (unlikely(!rq->elv.icq))
@@ -6914,16 +6914,19 @@ static struct bfq_queue *bfq_init_rq(struct request *rq)
true;
bfqq = bfq_split_bfqq(bic, bfqq);
- split = true;
-
if (!bfqq) {
bfqq = bfq_get_bfqq_handle_split(bfqd, bic, bio,
true, is_sync,
NULL);
if (unlikely(bfqq == &bfqd->oom_bfqq))
bfqq_already_existing = true;
- } else
+ else
+ bfq_bfqq_resume_state(bfqq, bfqd, bic,
+ false);
+ } else {
bfqq_already_existing = true;
+ bfq_bfqq_resume_state(bfqq, bfqd, bic, true);
+ }
if (!bfqq_already_existing) {
bfqq->waker_bfqq = waker_bfqq;
@@ -6959,18 +6962,8 @@ static struct bfq_queue *bfq_init_rq(struct request *rq)
* resume its state.
*/
if (likely(bfqq != &bfqd->oom_bfqq) && !bfqq->new_bfqq &&
- bfqq_process_refs(bfqq) == 1) {
+ bfqq_process_refs(bfqq) == 1)
bfqq->bic = bic;
- if (split) {
- /*
- * The queue has just been split from a shared
- * queue: restore the idle window and the
- * possible weight raising period.
- */
- bfq_bfqq_resume_state(bfqq, bfqd, bic,
- bfqq_already_existing);
- }
- }
/*
* Consider bfqq as possibly belonging to a burst of newly