Thread (16 messages) 16 messages, 4 authors, 2018-12-14

RE: +AFs-PATCH+AF0- blk-mq: Set request mapping to NULL in blk+AF8-mq+AF8-put+AF8-driver+AF8-tag

From: Kashyap Desai <kashyap.desai@broadcom.com>
Date: 2018-12-14 06:22:36

quoted
quoted
On Thu, Dec 06, 2018 at 11:15:13AM +0530, Kashyap Desai wrote:
quoted
quoted
If the 'tag' passed to scsi_host_find_tag() is valid, I think
there
quoted
quoted
quoted
quoted
shouldn't have such issue.

If you want to find outstanding IOs, maybe you can try
blk_mq_queue_tag_busy_iter()
or blk_mq_tagset_busy_iter(), because you may not know if the
passed
quoted
quoted
quoted
'tag'
quoted
to
scsi_host_find_tag() is valid or not.
We tried quick change in mpt3sas driver using
blk_mq_tagset_busy_iter
quoted
and
quoted
quoted
it returns/callback for valid requests (no stale entries are
returned).
quoted
quoted
quoted
Expected.
Above two APIs are only for blk-mq.  What about non-mq case ?
Driver
quoted
quoted
quoted
should use scsi_host_find_tag for non-mq and
blk_mq_tagset_busy_iter
quoted
for
quoted
quoted
blk-mq case ?
But your patch is only for blk-mq, is there same issue on non-mq
case?
quoted
Problematic part from below function is code path which goes from "
shost_use_blk_mq(shost))".
Non-mq path works fine because every IO completion set bqt-
tag_index[tag]
= NULL from blk_queue_end_tag().

I did similar things for mq path in this patch.

static inline struct scsi_cmnd *scsi_host_find_tag(struct Scsi_Host
*shost,
quoted
                int tag)
{
        struct request *req = NULL;

        if (tag == SCSI_NO_TAG)
                return NULL;

        if (shost_use_blk_mq(shost)) {
                u16 hwq = blk_mq_unique_tag_to_hwq(tag);

                if (hwq < shost->tag_set.nr_hw_queues) {
                        req =
blk_mq_tag_to_rq(shost->tag_set.tags[hwq],
quoted
                                blk_mq_unique_tag_to_tag(tag));
                }
        } else {
                req = blk_map_queue_find_tag(shost->bqt, tag);
        }

Hi Jens,

Any conclusion/feedback on this topic/patch ?  As discussed, This is a
safe
change and  good to have if no design issue.
Hi, Since we have not concluded on fix, we can resume discussion on next
revision of the patch. I will be posting V2 patch with complete fix.

Kashyap
Kashyap
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help