Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

blk-mq: Pass tag_set to blk_mq_free_rq_map/tags

To prepare for converting the tag->rqs freeing to be SRCU-based, the
tag_set is needed in the freeing helper functions.

This patch adds 'struct blk_mq_tag_set *' as the first parameter to
blk_mq_free_rq_map() and blk_mq_free_tags(), and updates all their call
sites.

This allows access to the tag_set's SRCU structure in the next step,
which will be used to free the tag maps after a grace period.

No functional change is intended in this patch.

Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Ming Lei and committed by
Jens Axboe
9ad8e5af aba19ee7

+8 -8
+1 -1
block/blk-mq-tag.c
··· 576 576 return NULL; 577 577 } 578 578 579 - void blk_mq_free_tags(struct blk_mq_tags *tags) 579 + void blk_mq_free_tags(struct blk_mq_tag_set *set, struct blk_mq_tags *tags) 580 580 { 581 581 sbitmap_queue_free(&tags->bitmap_tags); 582 582 sbitmap_queue_free(&tags->breserved_tags);
+5 -5
block/blk-mq.c
··· 3491 3491 } 3492 3492 } 3493 3493 3494 - void blk_mq_free_rq_map(struct blk_mq_tags *tags) 3494 + void blk_mq_free_rq_map(struct blk_mq_tag_set *set, struct blk_mq_tags *tags) 3495 3495 { 3496 3496 kfree(tags->rqs); 3497 3497 tags->rqs = NULL; 3498 3498 kfree(tags->static_rqs); 3499 3499 tags->static_rqs = NULL; 3500 3500 3501 - blk_mq_free_tags(tags); 3501 + blk_mq_free_tags(set, tags); 3502 3502 } 3503 3503 3504 3504 static enum hctx_type hctx_idx_to_type(struct blk_mq_tag_set *set, ··· 3560 3560 err_free_rqs: 3561 3561 kfree(tags->rqs); 3562 3562 err_free_tags: 3563 - blk_mq_free_tags(tags); 3563 + blk_mq_free_tags(set, tags); 3564 3564 return NULL; 3565 3565 } 3566 3566 ··· 4107 4107 4108 4108 ret = blk_mq_alloc_rqs(set, tags, hctx_idx, depth); 4109 4109 if (ret) { 4110 - blk_mq_free_rq_map(tags); 4110 + blk_mq_free_rq_map(set, tags); 4111 4111 return NULL; 4112 4112 } 4113 4113 ··· 4135 4135 { 4136 4136 if (tags) { 4137 4137 blk_mq_free_rqs(set, tags, hctx_idx); 4138 - blk_mq_free_rq_map(tags); 4138 + blk_mq_free_rq_map(set, tags); 4139 4139 } 4140 4140 } 4141 4141
+2 -2
block/blk-mq.h
··· 59 59 */ 60 60 void blk_mq_free_rqs(struct blk_mq_tag_set *set, struct blk_mq_tags *tags, 61 61 unsigned int hctx_idx); 62 - void blk_mq_free_rq_map(struct blk_mq_tags *tags); 62 + void blk_mq_free_rq_map(struct blk_mq_tag_set *set, struct blk_mq_tags *tags); 63 63 struct blk_mq_tags *blk_mq_alloc_map_and_rqs(struct blk_mq_tag_set *set, 64 64 unsigned int hctx_idx, unsigned int depth); 65 65 void blk_mq_free_map_and_rqs(struct blk_mq_tag_set *set, ··· 162 162 163 163 struct blk_mq_tags *blk_mq_init_tags(unsigned int nr_tags, 164 164 unsigned int reserved_tags, unsigned int flags, int node); 165 - void blk_mq_free_tags(struct blk_mq_tags *tags); 165 + void blk_mq_free_tags(struct blk_mq_tag_set *set, struct blk_mq_tags *tags); 166 166 167 167 unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data); 168 168 unsigned long blk_mq_get_tags(struct blk_mq_alloc_data *data, int nr_tags,