On Sun, 2017-10-22 at 13:47 +0000, Israel Rukshin wrote:
> @@ -441,6 +442,8 @@ static int blk_mq_sched_alloc_tags(struct request_queue 
> *q,
>       if (!hctx->sched_tags)
>               return -ENOMEM;
>  
> +     set->sched_tags[hctx_idx] = hctx->sched_tags;
> +
>       ret = blk_mq_alloc_rqs(set, hctx->sched_tags, hctx_idx, q->nr_requests);
>       if (ret)
>               blk_mq_sched_free_tags(set, hctx, hctx_idx);

Will this work as expected if a tag set is shared across multiple request 
queues?

> diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
> index c81b40e..c290de0 100644
> --- a/block/blk-mq-tag.c
> +++ b/block/blk-mq-tag.c
> @@ -322,6 +322,22 @@ int blk_mq_tagset_iter(struct blk_mq_tag_set *set, void 
> *data,
>               }
>       }
>  
> +     for (i = 0; i < set->nr_hw_queues; i++) {
> +             struct blk_mq_tags *sched_tags = set->sched_tags[i];
> +
> +             if (!sched_tags)
> +                     continue;
> +
> +             for (j = 0; j < sched_tags->nr_tags; j++) {
> +                     if (!sched_tags->static_rqs[j])
> +                             continue;
> +
> +                     ret = fn(data, sched_tags->static_rqs[j]);
> +                     if (ret)
> +                             goto out;
> +             }
> +     }

If both a scheduler tag and a driver tag have been assigned to a request, can 
this cause
blk_mq_tagset_iter() to call fn() twice for the same request?

Thanks,

Bart.

Reply via email to