mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "jianchao.wang" <jianchao.w.wang@oracle.com>
To: Keith Busch <keith.busch@intel.com>
Cc: axboe@kernel.dk, hch@lst.de, martin.petersen@oracle.com,
	josef@toxicpanda.com, ulf.hansson@linaro.org,
	linux-block@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/5]stop normal completion path entering a timeout req
Date: Thu, 21 Jun 2018 09:43:26 +0800	[thread overview]
Message-ID: <e87f5946-bb21-942e-2dcc-b24cee1ad23c@oracle.com> (raw)
In-Reply-To: <20180620181601.GA24145@localhost.localdomain>

Hi Keith

Thanks for your kindly response.

On 06/21/2018 02:16 AM, Keith Busch wrote:
> On Wed, Jun 20, 2018 at 09:22:39PM +0800, Jianchao Wang wrote:
>> Dear all
>>
>> scsi timeout and error handler are based on an assumption that normal
>> completion mustn't do anything on an timeout request. After 12f5b931
>> (blk-mq: Remove generation seqeunce), we lost this. __blk_mq_complete
>> request could ensure a request won't be completed twice, but it can
>> still complete a timeout request.
>> scsi (even other drivers) have been working on this assumption for many
>> years, it is dangerous to discard it suddenly. This patch set is to regain this.
> 
> I certainly don't want to harm any drivers. Could you possibly explain
> what about removing silent execptions from the completion handler and
> letting drivers control the destiny of requests they own is "dangerous"?

Letting LLDD control the destiny of requests they own is great idea !
But some of the LLDD (such as scsi) depends on an assumption (or setup)
normal completion mustn't do anything on an timeout request and this is provided
by block layer before 12f5b931 (blk-mq: Remove generation seqeunce) for many years.
timer and IO completion will both attempt to 'grab' the request, we have to make
sure that only one of them succeeds.

We could also refer to the following segment of the Documentation/scsi/scsi_eh.txt
" Note that this does not mean lower layers are quiescent.  If a LLDD
completed a scmd with error status, the LLDD and lower layers are
assumed to forget about the scmd at that point.  However, if a scmd
has timed out, unless hostt->eh_timed_out() made lower layers forget
about the scmd, which currently no LLDD does, the command is still
active as long as lower layers are concerned and completion could
occur at any time.  Of course, all such completions are ignored as the
timer has already expired.
"

So we have to preserve the ability of block layer that it could prevent
IO completion path from entering a timeout request.

With scsi-debug module, I tried to simulate a scenario where timeout and IO
completion path could occur concurrently, the system ran into crash easily.

> 
> A initial look at your proposal looks pretty harmful to me. A driver may
> return BLK_EH_RESET_TIMER, then call blk_mq_complete_req from another
> thread, and your patch will simply lose that request and escalate error
> recovery. That seems exactly what you shouldn't want to happen.
> 
Yes, this is indeed a hole.
The escalated error recovery should could handle this.
And it will be a better scenario than the one caused by trace between io completion
and timeout path.

Thanks
Jianchao

  reply	other threads:[~2018-06-21  1:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20 13:22 Jianchao Wang
2018-06-20 13:22 ` [PATCH 1/5] blk-mq: prevent normal completion from entering a timeout request Jianchao Wang
2018-06-20 13:22 ` [PATCH 2/5] nbd: use __blk_mq_complete_request in timeout path Jianchao Wang
2018-06-20 14:13   ` Josef Bacik
2018-06-20 13:22 ` [PATCH 3/5] null_blk: " Jianchao Wang
2018-06-20 13:22 ` [PATCH 4/5] mmc: " Jianchao Wang
2018-06-20 13:22 ` [PATCH 5/5] nvme: " Jianchao Wang
2018-06-20 14:39   ` Christoph Hellwig
2018-06-21  2:09     ` jianchao.wang
2018-06-24 18:07       ` Sagi Grimberg
2018-06-25  1:40         ` jianchao.wang
2018-06-25 18:51           ` Sagi Grimberg
2018-06-20 18:16 ` [PATCH 0/5]stop normal completion path entering a timeout req Keith Busch
2018-06-21  1:43   ` jianchao.wang [this message]
2018-06-21  8:19     ` Christoph Hellwig
2018-06-21  8:22       ` jianchao.wang
2018-06-22 15:10         ` Christoph Hellwig
2018-06-25  1:29           ` jianchao.wang
2018-06-21 13:13       ` jianchao.wang
2018-06-21 15:01         ` Keith Busch
2018-06-21 18:21       ` Bart Van Assche
2018-06-21 21:15         ` Keith Busch
2018-06-21 21:30           ` Bart Van Assche

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=e87f5946-bb21-942e-2dcc-b24cee1ad23c@oracle.com \
    --to=jianchao.w.wang@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=josef@toxicpanda.com \
    --cc=keith.busch@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ulf.hansson@linaro.org \
    /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

Powered by JetHome