Re: [PATCH 4/8] blk-mq: Facilitate a shared sbitmap per tagset

Hannes Reinecke
2019-11-26T14:10:58Z

On 11/26/19 2:59 PM, John Garry wrote:
>
>> +        blk_mq_free_tags(tags);
>>   }
>>     struct blk_mq_tags *blk_mq_alloc_rq_map(struct blk_mq_tag_set *set,
>>                       unsigned int hctx_idx,
>>                       unsigned int nr_tags,
>> -                    unsigned int reserved_tags)
>> +                    unsigned int reserved_tags,
>> +                    bool shared_tags)
>>   {
>>       struct blk_mq_tags *tags;
>>       int node;
>> @@ -2096,8 +2098,9 @@ struct blk_mq_tags *blk_mq_alloc_rq_map(struct
>> blk_mq_tag_set *set,
>>       if (node == NUMA_NO_NODE)
>>           node = set->numa_node;
>>   -    tags = blk_mq_init_tags(nr_tags, reserved_tags, node,
>> -                BLK_MQ_FLAG_TO_ALLOC_POLICY(set->flags));
>> +    tags = blk_mq_init_tags(set, nr_tags, reserved_tags, node,
>> +                BLK_MQ_FLAG_TO_ALLOC_POLICY(set->flags),
>> +                shared_tags);
>>       if (!tags)
>>           return NULL;
>>   @@ -2105,7 +2108,8 @@ struct blk_mq_tags *blk_mq_alloc_rq_map(struct
>> blk_mq_tag_set *set,
>>                    GFP_NOIO | __GFP_NOWARN | __GFP_NORETRY,
>>                    node);
>>       if (!tags->rqs) {
>> -        blk_mq_free_tags(tags);
>> +        if (!blk_mq_is_sbitmap_shared(set))
>> +            blk_mq_free_tags(tags);
>
> Don't we still need to free the tags memory but not have the
> blk_mq_free_tags()->sbitmap_queue_free() calls in case of shared tags?
>

Ah, indeed, you are right.
Oh, well, another round.

Cheers,

Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer