diff options
author | Ming Lei <tom.leiming@gmail.com> | 2017-02-22 11:14:01 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-03-08 17:56:12 +0100 |
commit | 6c8b232efea1ad3d263ff8b9c16b7e8767a77488 (patch) | |
tree | db30d630a2a170b7f67479654da43812c1d674fa /block/blk-mq.c | |
parent | blk-mq: make lifetime consitent between q/ctx and its kobject (diff) | |
download | linux-6c8b232efea1ad3d263ff8b9c16b7e8767a77488.tar.xz linux-6c8b232efea1ad3d263ff8b9c16b7e8767a77488.zip |
blk-mq: make lifetime consistent between hctx and its kobject
This patch removes kobject_put() over hctx in __blk_mq_unregister_dev(),
and trys to keep lifetime consistent between hctx and hctx's kobject.
Now blk_mq_sysfs_register() and blk_mq_sysfs_unregister() become
totally symmetrical, and kobject's refcounter drops to zero just
when the hctx is freed.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Tested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to '')
-rw-r--r-- | block/blk-mq.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index b985c236f50f..f70595e5fb86 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2256,8 +2256,7 @@ void blk_mq_release(struct request_queue *q) queue_for_each_hw_ctx(q, hctx, i) { if (!hctx) continue; - kfree(hctx->ctxs); - kfree(hctx); + kobject_put(&hctx->kobj); } q->mq_map = NULL; @@ -2336,8 +2335,6 @@ static void blk_mq_realloc_hw_ctxs(struct blk_mq_tag_set *set, blk_mq_exit_hctx(q, set, hctx, j); free_cpumask_var(hctx->cpumask); kobject_put(&hctx->kobj); - kfree(hctx->ctxs); - kfree(hctx); hctxs[j] = NULL; } |