From: Bart Van Assche <bvanassche@acm.org>
To: Kashyap Desai <kashyap.desai@broadcom.com>,
linux-block <linux-block@vger.kernel.org>,
Jens Axboe <axboe@kernel.dk>, Ming Lei <ming.lei@redhat.com>,
linux-scsi <linux-scsi@vger.kernel.org>
Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>,
Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
Sathya Prakash Veerichetty <sathya.prakash@broadcom.com>
Subject: Re: +AFs-PATCH+AF0- blk-mq: Set request mapping to NULL in blk+AF8-mq+AF8-put+AF8-driver+AF8-tag
Date: Tue, 04 Dec 2018 11:35:05 -0800 [thread overview]
Message-ID: <1543952105.185366.210.camel@acm.org> (raw)
In-Reply-To: <ce2cdcee7e8d8e21cc8398a882b9d6e3@mail.gmail.com>
On Tue, 2018-12-04 at 23:48 +0530, Kashyap Desai wrote:
> Let me explain the issue. It is not a race, but very straight issue.
Please clarify what makes you think that iterating over all requests does not
race with request completion. Is request submission perhaps blocked during the
firmware recovery process? Does the firmware recovery process wait for
completion interrupts that are in progress to finish?
> Let's
> say we have one scsi_device /dev/sda and total IO submitted + completed are
> some number 100.
> All the 100 IO is *completed*. Now, As part of Firmware recovery, driver
> tries to find our outstanding IOs using scsi_host_find_tag().
> Block layer will return all the 100 commands to the driver but really those
> 100 commands are not outstanding. This patch will return *actual*
> outstanding commands.
Would iterating over started requests be a good alternative to the patch
that you had posted? The header above blk_mq_tagset_busy_iter() is as follows
(this function is used by e.g. the skd driver for firmware recovery):
/**
* blk_mq_tagset_busy_iter - iterate over all started requests in a tag set
* @tagset: Tag set to iterate over.
* @fn: Pointer to the function that will be called for each started
* request. @fn will be called as follows: @fn(rq, @priv,
* reserved) where rq is a pointer to a request. 'reserved'
* indicates whether or not @rq is a reserved request.
* @priv: Will be passed as second argument to @fn.
*/
> I am not able to find right context from srp, but I check the srp code and
> looks like that driver is getting scmd using scsi_host_find_tag() for live
> command.
Sorry, my e-mail was a bit too short to be comprehensible. When running
sg_reset -d /dev/sd... in a loop it is possible that the SCSI reset handler
terminates a request while the SRP driver is handling a request completion
for one of the terminated requests. That is why both srp_process_srp() and
the reset handler call srp_claim_req() to make sure that only one of these
two contexts completes a request.
Bart.
next prev parent reply other threads:[~2018-12-04 19:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-04 10:00 [PATCH] blk-mq: Set request mapping to NULL in blk_mq_put_driver_tag Kashyap Desai
2018-12-04 11:35 ` Ming Lei
2018-12-04 16:51 ` Kashyap Desai
2018-12-04 14:48 ` Bart Van Assche
2018-12-04 16:47 ` Kashyap Desai
2018-12-04 17:14 ` Bart Van Assche
2018-12-04 18:18 ` +AFs-PATCH+AF0- blk-mq: Set request mapping to NULL in blk+AF8-mq+AF8-put+AF8-driver+AF8-tag Kashyap Desai
2018-12-04 19:35 ` Bart Van Assche [this message]
2018-12-06 0:33 ` Ming Lei
2018-12-06 5:45 ` Kashyap Desai
2018-12-06 15:22 ` Jens Axboe
2018-12-07 7:16 ` Kashyap Desai
2018-12-07 10:20 ` Ming Lei
2018-12-07 10:34 ` Kashyap Desai
2018-12-11 15:06 ` Kashyap Desai
2018-12-14 6:22 ` Kashyap Desai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1543952105.185366.210.camel@acm.org \
--to=bvanassche@acm.org \
--cc=axboe@kernel.dk \
--cc=kashyap.desai@broadcom.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=sathya.prakash@broadcom.com \
--cc=sreekanth.reddy@broadcom.com \
--cc=suganath-prabu.subramani@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.