From: hch@lst.de (hch@lst.de)
Subject: [PATCH 2/2] scsi: set timed out out mq requests to complete
Date: Mon, 23 Jul 2018 10:12:31 +0200 [thread overview]
Message-ID: <20180723081231.GB19247@lst.de> (raw)
In-Reply-To: <20180720172444.GH4093@localhost.localdomain>
On Fri, Jul 20, 2018@11:24:45AM -0600, Keith Busch wrote:
> My patch restores the state that scsi had in 4.17. It still has that
> gap that may lose requests forever when the scsi LLD always returns
> BLK_EH_RESET_TIMER (see virtio-scsi, for example). That gap existed prior,
> so that's not new with my patch. Maybe we can fix that with a slight
> modification to my previous patch. It looks like SCSI really wants to
> block completions only when it hands off the command to the error handler,
> so we don't need to have the inflight -> compete -> inflight transition,
> and the following is all that's needed:
Btw, one thing we should do in blk-mq and scsi is to make the time
optional. If the blk_mq driver doesn't even have a timeout structure
there is no point in timing out requests and enter the timeout handler
ever. Same for those scsi drivers always returning BLK_EH_RESET_TIMER.
Whether never having timeouts is a good idea is a different discussion,
but as long as we have such drivers we should handle them somewhat sane.
> ---
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index 8932ae81a15a..902c30d3c0ed 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -296,6 +296,8 @@ enum blk_eh_timer_return scsi_times_out(struct request *req)
> rtn = host->hostt->eh_timed_out(scmd);
>
> if (rtn == BLK_EH_DONE) {
> + if (req->q->mq_ops && blk_mq_mark_complete(req))
> + return rtn;
This looks pretty sensible to me as a band-aid. It just needs a very
detailed comment explaining what is going on here.
next prev parent reply other threads:[~2018-07-23 8:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-19 21:26 [PATCH 1/2] blk-mq: export setting request completion state Keith Busch
2018-07-19 21:26 ` [PATCH 2/2] scsi: set timed out out mq requests to complete Keith Busch
2018-07-20 6:52 ` Johannes Thumshirn
2018-07-20 14:05 ` Keith Busch
2018-07-20 14:41 ` Christoph Hellwig
2018-07-20 14:50 ` Keith Busch
2018-07-20 15:12 ` Bart Van Assche
2018-07-20 15:56 ` Keith Busch
2018-07-20 16:03 ` Bart Van Assche
2018-07-20 16:12 ` Keith Busch
2018-07-20 16:20 ` Bart Van Assche
2018-07-20 16:23 ` Keith Busch
2018-07-20 16:45 ` Bart Van Assche
2018-07-20 17:24 ` Keith Busch
2018-07-23 8:12 ` hch [this message]
2018-07-23 13:59 ` Bart Van Assche
2018-07-23 14:04 ` Keith Busch
2018-07-23 8:09 ` [PATCH 1/2] blk-mq: export setting request completion state Christoph Hellwig
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=20180723081231.GB19247@lst.de \
--to=hch@lst.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox