# Re: \[bug report\] shared tags causes IO hang and performance drop

- From: John Garry \<hidden\>
- Date: 2021-07-07 17:13:27 
- List: linux-block
- Page: https://ratatoskr.run/linux-block/2021/07/6403823
- Thread: https://ratatoskr.run/linux-block/2021/04/6402072/t.md

```text
On 27/04/2021 10:52, Ming Lei wrote:
>>> Then you just waste lots of memory, I remember that scsi request payload
>>> is a bit big.
>> It's true that we waste much memory for regular static requests for when
>> using hostwide tags today.
>>
>> One problem in trying to use a single set of "hostwide" static requests is
>> that we call blk_mq_init_request(..., hctx_idx, ...) ->
>> set->ops->init_request(.., hctx_idx, ...) for each static rq, and this would
>> not work for a single set of "hostwide" requests.
>>
>> And I see a similar problem for a "request queue-wide" sched static
>> requests.
>>
>> Maybe we can improve this in future.
> OK, fair enough.
>

JFYI, I am working on this now.

My idea is to introduce a hostwide and request-wide static requests (for hostwide tagset), and have the per-hctx tags point at them, so that we don't need to allocate per-hctx static requests.

SCSI init_request callback just ignores hctx_idx passed, so then we can just call init_request(hctx_idx = 0) for those hostwide/request queue-wide static requests.

Thanks,
John

```
