[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221101093417.10540-17-shikemeng@huawei.com>
Date: Tue, 1 Nov 2022 17:34:13 +0800
From: Kemeng Shi <shikemeng@...wei.com>
To: <paolo.valente@...aro.org>, <axboe@...nel.dk>
CC: <linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<shikemeng@...wei.com>
Subject: [PATCH 16/20] block, bfq: remove unnecessary goto tag in __bfq_weights_tree_remove
Do free work if num_active == 0 and remove unnecessary tag
reset_entity_pointer.
Signed-off-by: Kemeng Shi <shikemeng@...wei.com>
---
block/bfq-iosched.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index dd9a51255a0f..1402dfd9f448 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -950,13 +950,11 @@ void __bfq_weights_tree_remove(struct bfq_data *bfqd,
return;
bfqq->weight_counter->num_active--;
- if (bfqq->weight_counter->num_active > 0)
- goto reset_entity_pointer;
-
- rb_erase_cached(&bfqq->weight_counter->weights_node, root);
- kfree(bfqq->weight_counter);
+ if (bfqq->weight_counter->num_active == 0) {
+ rb_erase_cached(&bfqq->weight_counter->weights_node, root);
+ kfree(bfqq->weight_counter);
+ }
-reset_entity_pointer:
bfqq->weight_counter = NULL;
bfq_put_queue(bfqq);
}
--
2.30.0
Powered by blists - more mailing lists