diff options
author | Weiping Zhang <zhangweiping@didiglobal.com> | 2020-05-07 16:03:39 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-05-10 01:15:12 +0300 |
commit | 2e194422f1eb4cdf5d6697bcfe0bbaf3059bbb5e (patch) | |
tree | a21fdb04b4a4d5b4453e1ef8118595275a15d93b | |
parent | 873f1c8df7e0dac2156a722f3c7848a30693a242 (diff) | |
download | linux-2e194422f1eb4cdf5d6697bcfe0bbaf3059bbb5e.tar.xz |
block: free both rq_map and request
Allocation:
__blk_mq_alloc_rq_map
blk_mq_alloc_rq_map
blk_mq_alloc_rq_map
tags = blk_mq_init_tags : kzalloc_node:
tags->rqs = kcalloc_node
tags->static_rqs = kcalloc_node
blk_mq_alloc_rqs
p = alloc_pages_node
tags->static_rqs[i] = p + offset;
Free:
blk_mq_free_rq_map
kfree(tags->rqs);
kfree(tags->static_rqs);
blk_mq_free_tags
kfree(tags);
The page allocated in blk_mq_alloc_rqs cannot be released,
so we should use blk_mq_free_map_and_requests here.
blk_mq_free_map_and_requests
blk_mq_free_rqs
__free_pages : cleanup for blk_mq_alloc_rqs
blk_mq_free_rq_map : cleanup for blk_mq_alloc_rq_map
Signed-off-by: Weiping Zhang <zhangweiping@didiglobal.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | block/blk-mq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index bcc3a2397d4a..e9643b0d6860 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -3006,7 +3006,7 @@ static int __blk_mq_alloc_rq_maps(struct blk_mq_tag_set *set) out_unwind: while (--i >= 0) - blk_mq_free_rq_map(set->tags[i]); + blk_mq_free_map_and_requests(set, i); return -ENOMEM; } |