From: keith.busch@linux.intel.com (Keith Busch)
Subject: [RFC PATCH 3/3] blk-mq: Remove generation seqeunce
Date: Wed, 18 Jul 2018 16:53:11 -0600 [thread overview]
Message-ID: <20180718225311.GD32160@localhost.localdomain> (raw)
In-Reply-To: <20180718203936.GA21011@lst.de>
On Wed, Jul 18, 2018@10:39:36PM +0200, hch@lst.de wrote:
> On Wed, Jul 18, 2018@09:56:50PM +0200, hch@lst.de wrote:
> > On Fri, Jul 13, 2018@05:58:08PM -0600, Keith Busch wrote:
> > > Of the two you mentioned, yours is preferable IMO. While I appreciate
> > > Jianchao's detailed analysis, it's hard to take a proposal seriously
> > > that so colourfully calls everyone else "dangerous" while advocating
> > > for silently losing requests on purpose.
> > >
> > > But where's the option that fixes scsi to handle hardware completions
> > > concurrently with arbitrary timeout software? Propping up that house of
> > > cards can't be the only recourse.
> >
> > The important bit is that we need to fix this issue quickly. We are
> > past -rc5 so I'm rather concerned about anything too complicated.
> >
> > I'm not even sure SCSI has a problem with multiple completions happening
> > at the same time, but it certainly has a problem with bypassing
> > blk_mq_complete_request from the EH path.
> >
> > I think we can solve this properly, but I also think we are way to late
> > in the 4.18 cycle to fix it properly. For now I fear we'll just have
> > to revert the changes and try again for 4.19 or even 4.20 if we don't
> > act quickly enough.
>
> So here is a quick attempt at the revert while also trying to keep
> nvme working. Keith, Bart, Jianchao - does this looks reasonable
> as a 4.18 band aid?
>
> http://git.infradead.org/users/hch/block.git/shortlog/refs/heads/blk-eh-revert
Hm, I not really a fan. The far majority of blk-mq drivers don't even
implement a timeout, and reverting it will lose their requests forever
if they complete at the same time as a timeout.
Of the remaining drivers, most of those don't want the reverted behavior
either. It actually looks like scsi is the only mq driver that wants
to block completions. In the short term, scsi can make that happen with
just three lines of code.
---
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 8932ae81a15a..03986af3076c 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -286,6 +286,10 @@ enum blk_eh_timer_return scsi_times_out(struct request *req)
enum blk_eh_timer_return rtn = BLK_EH_DONE;
struct Scsi_Host *host = scmd->device->host;
+ if (req->q->mq_ops && cmpxchg(&rq->state, MQ_RQ_IN_FLIGHT, MQ_RQ_COMPLETE) !=
+ MQ_RQ_IN_FLIGHT);
+ return rtn;
+
trace_scsi_dispatch_cmd_timeout(scmd);
scsi_log_completion(scmd, TIMEOUT_ERROR);
--
next prev parent reply other threads:[~2018-07-18 22:53 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-21 23:11 [RFC PATCH 0/3] blk-mq: Timeout rework Keith Busch
2018-05-21 23:11 ` [RFC PATCH 1/3] blk-mq: Reference count request usage Keith Busch
2018-05-22 2:27 ` Ming Lei
2018-05-22 15:19 ` Christoph Hellwig
2018-05-21 23:11 ` [RFC PATCH 2/3] blk-mq: Fix timeout and state order Keith Busch
2018-05-22 2:28 ` Ming Lei
2018-05-22 15:24 ` Christoph Hellwig
2018-05-22 16:27 ` Bart Van Assche
2018-05-21 23:11 ` [RFC PATCH 3/3] blk-mq: Remove generation seqeunce Keith Busch
2018-05-21 23:29 ` Bart Van Assche
2018-05-22 14:15 ` Keith Busch
2018-05-22 16:29 ` Bart Van Assche
2018-05-22 16:34 ` Keith Busch
2018-05-22 16:48 ` Bart Van Assche
2018-05-22 2:49 ` Ming Lei
2018-05-22 3:16 ` Jens Axboe
2018-05-22 3:47 ` Ming Lei
2018-05-22 3:51 ` Jens Axboe
2018-05-22 8:51 ` Ming Lei
2018-05-22 14:35 ` Jens Axboe
2018-05-22 14:20 ` Keith Busch
2018-05-22 14:37 ` Ming Lei
2018-05-22 14:46 ` Keith Busch
2018-05-22 14:57 ` Ming Lei
2018-05-22 15:01 ` Keith Busch
2018-05-22 15:07 ` Ming Lei
2018-05-22 15:17 ` Keith Busch
2018-05-22 15:23 ` Ming Lei
2018-05-22 16:17 ` Christoph Hellwig
2018-05-23 0:34 ` Ming Lei
2018-05-23 14:35 ` Keith Busch
2018-05-24 1:52 ` Ming Lei
2018-05-23 5:48 ` Hannes Reinecke
2018-07-12 18:16 ` Bart Van Assche
2018-07-12 19:24 ` Keith Busch
2018-07-12 22:24 ` Bart Van Assche
2018-07-13 1:12 ` jianchao.wang
2018-07-13 2:40 ` jianchao.wang
2018-07-13 15:43 ` Keith Busch
2018-07-13 15:52 ` Bart Van Assche
2018-07-13 18:47 ` Keith Busch
2018-07-13 23:03 ` Bart Van Assche
2018-07-13 23:58 ` Keith Busch
2018-07-18 19:56 ` hch
2018-07-18 20:39 ` hch
2018-07-18 21:05 ` Bart Van Assche
2018-07-18 22:53 ` Keith Busch [this message]
2018-07-18 20:53 ` Keith Busch
2018-07-18 20:58 ` Bart Van Assche
2018-07-18 21:17 ` Keith Busch
2018-07-18 21:30 ` Bart Van Assche
2018-07-18 21:33 ` Keith Busch
2018-07-19 13:19 ` hch
2018-07-19 14:59 ` Keith Busch
2018-07-19 15:56 ` Keith Busch
2018-07-19 16:04 ` Bart Van Assche
2018-07-19 16:22 ` Keith Busch
2018-07-19 16:29 ` hch
2018-07-19 20:18 ` Keith Busch
2018-07-19 13:22 ` hch
2018-05-21 23:29 ` [RFC PATCH 0/3] blk-mq: Timeout rework Bart Van Assche
2018-05-22 14:06 ` Keith Busch
2018-05-22 16:30 ` Bart Van Assche
2018-05-22 16:44 ` Keith Busch
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=20180718225311.GD32160@localhost.localdomain \
--to=keith.busch@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).