[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <89cd1985-39c7-2965-d25b-2ee2c183d057@huawei.com>
Date: Thu, 14 Nov 2019 09:41:51 +0000
From: John Garry <john.garry@...wei.com>
To: Hannes Reinecke <hare@...e.de>,
"axboe@...nel.dk" <axboe@...nel.dk>,
"jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>
CC: "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"ming.lei@...hat.com" <ming.lei@...hat.com>,
"hare@...e.com" <hare@...e.com>,
"bvanassche@....org" <bvanassche@....org>,
"chenxiang (M)" <chenxiang66@...ilicon.com>
Subject: Re: [PATCH RFC 3/5] blk-mq: Facilitate a shared tags per tagset
On 13/11/2019 18:38, Hannes Reinecke wrote:
>> Hi Hannes,
>>
>>> Oh, my. Indeed, that's correct.
>>
>> The tags could be kept in sync like this:
>>
>> shared_tag = blk_mq_get_tag(shared_tagset);
>> if (shared_tag != -1)
>> sbitmap_set(hctx->tags, shared_tag);
>>
>> But that's obviously not ideal.
>>
> Actually, I _do_ prefer keeping both in sync.
> We might want to check if the 'normal' tag is set (typically it would
> not, but then, who knows ...)
> The beauty here is that both 'shared' and 'normal' tag are in sync, so
> if a driver would be wanting to use the tag as index into a command
> array it can do so without any surprises.
>
> Why do you think it's not ideal?
A few points:
- Getting a bit from one tagset and then setting it in another tagset is
a bit clunky.
- There may be an atomicity of the getting the shared tag bit and
setting the hctx tag bit - I don't think that there is.
- Consider that sometimes we may want to check if there is space on a hw
queue - checking the hctx tags is not really proper any longer, as
typically there would always be space on hctx, but not always the shared
tags. We did delete blk_mq_can_queue() yesterday, which would be an
example of that. Need to check if there are others.
Having said all that, the obvious advantage is performance gain, can
still use request.tag and so maybe less intrusive changes.
I'll have a look at the implementation. The devil is mostly in the detail...
Thanks,
John
Powered by blists - more mailing lists