[PATCH 1/4] blk-cgroup: Remove unnecessary blk_ioprio_exit in blkcg_init_queue

Kemeng Shi posted 4 patches 3 years, 6 months ago
[PATCH 1/4] blk-cgroup: Remove unnecessary blk_ioprio_exit in blkcg_init_queue
Posted by Kemeng Shi 3 years, 6 months ago
Function blk_ioprio_init only alloc blkg_policy_data which will be freed
in blkg_destroy_all, so no blk_ioprio_exit is called when blk_throtl_init
is failed in blkcg_init_queue. Also blk_ioprio_exit is not called in
blkcg_exit_queue for the same reason. Just remove blk_ioprio_exit to
keep behavior consistent.

Signed-off-by: Kemeng Shi <shikemeng@huawei.com>
---
 block/blk-cgroup.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 869af9d72bcf..bc4dec705572 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1302,7 +1302,6 @@ int blkcg_init_queue(struct request_queue *q)
 	ret = blk_iolatency_init(q);
 	if (ret) {
 		blk_throtl_exit(q);
-		blk_ioprio_exit(q);
 		goto err_destroy_all;
 	}
 
-- 
2.30.0
Re: [PATCH 1/4] blk-cgroup: Remove unnecessary blk_ioprio_exit in blkcg_init_queue
Posted by Christoph Hellwig 3 years, 6 months ago
On Mon, Oct 10, 2022 at 10:38:56AM +0800, Kemeng Shi wrote:
> Function blk_ioprio_init only alloc blkg_policy_data which will be freed
> in blkg_destroy_all, so no blk_ioprio_exit is called when blk_throtl_init
> is failed in blkcg_init_queue. Also blk_ioprio_exit is not called in
> blkcg_exit_queue for the same reason. Just remove blk_ioprio_exit to
> keep behavior consistent.

This code looks very different in current mainline.
Re: [PATCH 1/4] blk-cgroup: Remove unnecessary blk_ioprio_exit in blkcg_init_queue
Posted by Kemeng Shi 3 years, 6 months ago

on 10/10/2022 3:37 PM, Christoph Hellwig wrote:
> On Mon, Oct 10, 2022 at 10:38:56AM +0800, Kemeng Shi wrote:
>> Function blk_ioprio_init only alloc blkg_policy_data which will be freed
>> in blkg_destroy_all, so no blk_ioprio_exit is called when blk_throtl_init
>> is failed in blkcg_init_queue. Also blk_ioprio_exit is not called in
>> blkcg_exit_queue for the same reason. Just remove blk_ioprio_exit to
>> keep behavior consistent.
> 
> This code looks very different in current mainline.
Thanks for review. I will remove this patch and make new patches based on
mainline code.
-- 
Best wishes
Kemeng Shi