On 16/11/2020 09:03, Hannes Reinecke wrote:
Hi Hannes,
Is there any way to ensure that the request allocated is associated
with some determined HW queue here?
The reason for this requirement is that sometimes the LLDD must submit
some internal IO (for which we allocate an "internal command") on a
specific HW queue. An example of this is internal abort IO commands,
which should be submitted on the same queue as the IO which we are
attempting to abort was submitted.
So, for sure, the LLDD does not have to honor the hwq associated with
the request and submit on the desired queue, but then we lose the
blk-mq CPU hotplug protection. And maybe other problems.
One way to achieve this is to run scsi_get_internal_cmd() on a CPU
associated with the desired HW queue, but that's a bit hacky. Not sure
of another way.
Hmm. You are correct for the 'abort' command; that typically needs to be
submitted to a specific hwq.
So now I see that we have blk_mq_alloc_request_hctx(..., hctx_idx)
already, so that should do the job :)
Thanks,
John