public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: "jianchao.wang" <jianchao.w.wang@oracle.com>
To: Ming Lei <tom.leiming@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>, Keith Busch <keith.busch@intel.com>,
	Sagi Grimberg <sagi@grimberg.me>,
	linux-nvme <linux-nvme@lists.infradead.org>,
	Ming Lei <ming.lei@redhat.com>,
	linux-block <linux-block@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH 1/2] nvme: pci: simplify timeout handling
Date: Sun, 29 Apr 2018 10:21:21 +0800	[thread overview]
Message-ID: <22dfe86b-8981-cc66-4a5b-216aa26dd003@oracle.com> (raw)
In-Reply-To: <CACVXFVO5anknwHUdPpHVBMvirh93UDS__qVrJvw7R_ThY+yjGA@mail.gmail.com>

Hi ming

On 04/29/2018 09:36 AM, Ming Lei wrote:
> On Sun, Apr 29, 2018 at 6:27 AM, Ming Lei <tom.leiming@gmail.com> wrote:
>> On Sun, Apr 29, 2018 at 5:57 AM, Ming Lei <tom.leiming@gmail.com> wrote:
>>> On Sat, Apr 28, 2018 at 10:00 PM, jianchao.wang
>>> <jianchao.w.wang@oracle.com> wrote:
>>>> Hi ming
>>>>
>>>> On 04/27/2018 10:57 PM, Ming Lei wrote:
>>>>> I may not understand your point, once blk_sync_queue() returns, the
>>>>> timer itself is deactivated, meantime the synced .nvme_timeout() only
>>>>> returns EH_NOT_HANDLED before the deactivation.
>>>>>
>>>>> That means this timer won't be expired any more, so could you explain
>>>>> a bit why timeout can come again after blk_sync_queue() returns
>>>>
>>>> Please consider the following case:
>>>>
>>>> blk_sync_queue
>>>>   -> del_timer_sync
>>>>                           blk_mq_timeout_work
>>>>                             -> blk_mq_check_expired // return the timeout value
>>>>                             -> blk_mq_terninate_expired
>>>>                               -> .timeout //return EH_NOT_HANDLED
>>>>                             -> mod_timer // setup the timer again based on the result of blk_mq_check_expired
>>>>   -> cancel_work_sync
>>>> So after the blk_sync_queue, the timer may come back again, then the timeout work.
>>>
>>> OK, I was trying to avoid to use blk_abort_request(), but looks we
>>> may have to depend on it or similar way.
>>>
>>> BTW, that means blk_sync_queue() has been broken, even though the uses
>>> in blk_cleanup_queue().
>>>
>>> Another approach is to introduce one perpcu_ref of
>>> 'q->timeout_usage_counter' for
>>> syncing timeout, seems a bit over-kill too, but simpler in both theory
>>> and implement.
>>
>> Or one timout_mutex is enough.
> 
> Turns out it is SRCU.
> 
after split the timeout path into timer and workqueue two parts, if we don't drain the in-flight requests, the request_queue->timeout and the timeout work look like an issue of 'chicken and egg'.
how about introduce a flag to disable triggering of timeout work ?


Thanks
Jianchao

  reply	other threads:[~2018-04-29  2:21 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-26 12:39 [PATCH 0/2] nvme: pci: fix & improve timeout handling Ming Lei
2018-04-26 12:39 ` [PATCH 1/2] nvme: pci: simplify " Ming Lei
2018-04-26 15:07   ` jianchao.wang
2018-04-26 15:57     ` Ming Lei
2018-04-26 16:16       ` Ming Lei
2018-04-27  1:37       ` jianchao.wang
2018-04-27 14:57         ` Ming Lei
2018-04-28 14:00           ` jianchao.wang
2018-04-28 21:57             ` Ming Lei
2018-04-28 22:27               ` Ming Lei
2018-04-29  1:36                 ` Ming Lei
2018-04-29  2:21                   ` jianchao.wang [this message]
2018-04-29 14:13                     ` Ming Lei
2018-04-27 17:51   ` Keith Busch
2018-04-28  3:50     ` Ming Lei
2018-04-28 13:35       ` Keith Busch
2018-04-28 14:31         ` jianchao.wang
2018-04-28 21:39         ` Ming Lei
2018-04-30 19:52           ` Keith Busch
2018-04-30 23:14             ` Ming Lei
2018-05-08 15:30       ` Keith Busch
2018-05-10 20:52         ` Ming Lei
2018-05-10 21:05           ` Keith Busch
2018-05-10 21:10             ` Ming Lei
2018-05-10 21:18               ` Keith Busch
2018-05-10 21:24                 ` Ming Lei
2018-05-10 21:44                   ` Keith Busch
2018-05-10 21:50                     ` Ming Lei
2018-05-10 21:53                     ` Ming Lei
2018-05-10 22:03                 ` Ming Lei
2018-05-10 22:43                   ` Keith Busch
2018-05-11  0:14                     ` Ming Lei
2018-05-11  2:10             ` Ming Lei
2018-04-26 12:39 ` [PATCH 2/2] nvme: pci: guarantee EH can make progress Ming Lei
2018-04-26 16:24   ` Keith Busch
2018-04-28  3:28     ` Ming Lei

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=22dfe86b-8981-cc66-4a5b-216aa26dd003@oracle.com \
    --to=jianchao.w.wang@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=keith.busch@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=ming.lei@redhat.com \
    --cc=sagi@grimberg.me \
    --cc=tom.leiming@gmail.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