From: Oleksandr Natalenko <oleksandr@natalenko.name>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@fb.com>,
linux-block@vger.kernel.org,
Christoph Hellwig <hch@infradead.org>,
Bart Van Assche <bart.vanassche@sandisk.com>,
linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>,
"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
Johannes Thumshirn <jthumshirn@suse.de>,
Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH V3 0/8] block/scsi: safe SCSI quiescing
Date: Sat, 02 Sep 2017 16:47:19 +0200 [thread overview]
Message-ID: <9524396.xaYzBpxu59@natalenko.name> (raw)
In-Reply-To: <20170902130840.24609-1-ming.lei@redhat.com>
Again,
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
On sobota 2. z=C3=A1=C5=99=C3=AD 2017 15:08:32 CEST Ming Lei wrote:
> Hi,
>=20
> The current SCSI quiesce isn't safe and easy to trigger I/O deadlock.
>=20
> Once SCSI device is put into QUIESCE, no new request except for RQF_PREEM=
PT
> can be dispatched to SCSI successfully, and scsi_device_quiesce() just
> simply waits for completion of I/Os dispatched to SCSI stack. It isn't
> enough at all.
>=20
> Because new request still can be allocated, but all the allocated
> requests can't be dispatched successfully, so request pool can be
> consumed up easily.
>=20
> Then request with RQF_PREEMPT can't be allocated, and system may
> hang forever, such as during system suspend or SCSI domain alidation.
>=20
> Both IO hang inside system suspend[1] or SCSI domain validation
> were reported before.
>=20
> This patch introduces preempt freez, and tries to solve the issue
> by preempt freezing block queue during SCSI quiesce, and allows
> to allocate request of RQF_PREEMPT when queue is preempt-frozen.
>=20
> Both SCSI and SCSI_MQ have this IO deadlock issue, this patch fixes
> them all by introducing blk_freeze_queue_preempt() and
> blk_unfreeze_queue_preempt(), also unifying current interfaces for
> freezing queue between block legacy and blk-mq.
>=20
> Oleksandr has verified that this patchset V2 fixes his I/O hang
> during suspend/resume cycle.
>=20
> V3:
> - introduce q->preempt_unfreezing to fix one bug of preempt freeze
> - call blk_queue_enter_live() only when queue is preempt frozen
> - cleanup a bit on the implementation of preempt freeze
> - only patch 6 and 7 are changed
>=20
> V2:
> - drop the 1st patch in V1 because percpu_ref_is_dying() is
> enough as pointed by Tejun
> - introduce preempt version of blk_[freeze|unfreeze]_queue
> - sync between preempt freeze and normal freeze
> - fix warning from percpu-refcount as reported by Oleksandr
>=20
>=20
> [1] https://marc.info/?t=3D150340250100013&r=3D3&w=3D2
>=20
>=20
>=20
> Ming Lei (8):
> blk-mq: rename blk_mq_unfreeze_queue as blk_unfreeze_queue
> blk-mq: rename blk_mq_freeze_queue as blk_freeze_queue
> blk-mq: only run hw queues for blk-mq
> blk-mq: rename blk_mq_freeze_queue_wait as blk_freeze_queue_wait
> block: tracking request allocation with q_usage_counter
> block: introduce preempt version of blk_[freeze|unfreeze]_queue
> block: allow to allocate req with REQF_PREEMPT when queue is preempt
> frozen
> SCSI: preempt freeze block queue when SCSI device is put into quiesce
>=20
> block/bfq-iosched.c | 2 +-
> block/blk-cgroup.c | 8 +--
> block/blk-core.c | 53 ++++++++++++---
> block/blk-mq.c | 170
> +++++++++++++++++++++++++++++++++++++++-------- block/blk-mq.h =
|=20
> 1 -
> block/blk.h | 17 +++++
> block/elevator.c | 4 +-
> drivers/block/loop.c | 16 ++---
> drivers/block/rbd.c | 2 +-
> drivers/nvme/host/core.c | 8 +--
> drivers/scsi/scsi_lib.c | 22 +++++-
> include/linux/blk-mq.h | 15 +++--
> include/linux/blkdev.h | 21 +++++-
> 13 files changed, 273 insertions(+), 66 deletions(-)
WARNING: multiple messages have this Message-ID (diff)
From: Oleksandr Natalenko <oleksandr@natalenko.name>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@fb.com>,
linux-block@vger.kernel.org,
Christoph Hellwig <hch@infradead.org>,
Bart Van Assche <bart.vanassche@sandisk.com>,
linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>,
"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
Johannes Thumshirn <jthumshirn@suse.de>,
Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH V3 0/8] block/scsi: safe SCSI quiescing
Date: Sat, 02 Sep 2017 16:47:19 +0200 [thread overview]
Message-ID: <9524396.xaYzBpxu59@natalenko.name> (raw)
In-Reply-To: <20170902130840.24609-1-ming.lei@redhat.com>
Again,
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
On sobota 2. září 2017 15:08:32 CEST Ming Lei wrote:
> Hi,
>
> The current SCSI quiesce isn't safe and easy to trigger I/O deadlock.
>
> Once SCSI device is put into QUIESCE, no new request except for RQF_PREEMPT
> can be dispatched to SCSI successfully, and scsi_device_quiesce() just
> simply waits for completion of I/Os dispatched to SCSI stack. It isn't
> enough at all.
>
> Because new request still can be allocated, but all the allocated
> requests can't be dispatched successfully, so request pool can be
> consumed up easily.
>
> Then request with RQF_PREEMPT can't be allocated, and system may
> hang forever, such as during system suspend or SCSI domain alidation.
>
> Both IO hang inside system suspend[1] or SCSI domain validation
> were reported before.
>
> This patch introduces preempt freez, and tries to solve the issue
> by preempt freezing block queue during SCSI quiesce, and allows
> to allocate request of RQF_PREEMPT when queue is preempt-frozen.
>
> Both SCSI and SCSI_MQ have this IO deadlock issue, this patch fixes
> them all by introducing blk_freeze_queue_preempt() and
> blk_unfreeze_queue_preempt(), also unifying current interfaces for
> freezing queue between block legacy and blk-mq.
>
> Oleksandr has verified that this patchset V2 fixes his I/O hang
> during suspend/resume cycle.
>
> V3:
> - introduce q->preempt_unfreezing to fix one bug of preempt freeze
> - call blk_queue_enter_live() only when queue is preempt frozen
> - cleanup a bit on the implementation of preempt freeze
> - only patch 6 and 7 are changed
>
> V2:
> - drop the 1st patch in V1 because percpu_ref_is_dying() is
> enough as pointed by Tejun
> - introduce preempt version of blk_[freeze|unfreeze]_queue
> - sync between preempt freeze and normal freeze
> - fix warning from percpu-refcount as reported by Oleksandr
>
>
> [1] https://marc.info/?t=150340250100013&r=3&w=2
>
>
>
> Ming Lei (8):
> blk-mq: rename blk_mq_unfreeze_queue as blk_unfreeze_queue
> blk-mq: rename blk_mq_freeze_queue as blk_freeze_queue
> blk-mq: only run hw queues for blk-mq
> blk-mq: rename blk_mq_freeze_queue_wait as blk_freeze_queue_wait
> block: tracking request allocation with q_usage_counter
> block: introduce preempt version of blk_[freeze|unfreeze]_queue
> block: allow to allocate req with REQF_PREEMPT when queue is preempt
> frozen
> SCSI: preempt freeze block queue when SCSI device is put into quiesce
>
> block/bfq-iosched.c | 2 +-
> block/blk-cgroup.c | 8 +--
> block/blk-core.c | 53 ++++++++++++---
> block/blk-mq.c | 170
> +++++++++++++++++++++++++++++++++++++++-------- block/blk-mq.h |
> 1 -
> block/blk.h | 17 +++++
> block/elevator.c | 4 +-
> drivers/block/loop.c | 16 ++---
> drivers/block/rbd.c | 2 +-
> drivers/nvme/host/core.c | 8 +--
> drivers/scsi/scsi_lib.c | 22 +++++-
> include/linux/blk-mq.h | 15 +++--
> include/linux/blkdev.h | 21 +++++-
> 13 files changed, 273 insertions(+), 66 deletions(-)
next prev parent reply other threads:[~2017-09-02 14:47 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-02 13:08 [PATCH V3 0/8] block/scsi: safe SCSI quiescing Ming Lei
2017-09-02 13:08 ` [PATCH V3 1/8] blk-mq: rename blk_mq_unfreeze_queue as blk_unfreeze_queue Ming Lei
2017-09-02 13:08 ` [PATCH V3 2/8] blk-mq: rename blk_mq_freeze_queue as blk_freeze_queue Ming Lei
2017-09-02 13:08 ` [PATCH V3 3/8] blk-mq: only run hw queues for blk-mq Ming Lei
2017-09-02 13:08 ` [PATCH V3 4/8] blk-mq: rename blk_mq_freeze_queue_wait as blk_freeze_queue_wait Ming Lei
2017-09-02 13:08 ` [PATCH V3 5/8] block: tracking request allocation with q_usage_counter Ming Lei
2017-09-02 13:08 ` [PATCH V3 6/8] block: introduce preempt version of blk_[freeze|unfreeze]_queue Ming Lei
2017-09-04 15:21 ` Bart Van Assche
2017-09-04 15:21 ` Bart Van Assche
2017-09-04 16:20 ` Ming Lei
2017-09-02 13:08 ` [PATCH V3 7/8] block: allow to allocate req with REQF_PREEMPT when queue is preempt frozen Ming Lei
2017-09-02 13:12 ` Ming Lei
2017-09-04 4:13 ` Bart Van Assche
2017-09-04 4:13 ` Bart Van Assche
2017-09-04 7:16 ` Ming Lei
2017-09-04 15:40 ` Bart Van Assche
2017-09-04 15:40 ` Bart Van Assche
2017-09-04 16:08 ` Ming Lei
2017-09-04 16:18 ` Bart Van Assche
2017-09-04 16:18 ` Bart Van Assche
2017-09-04 16:28 ` Ming Lei
2017-09-05 1:40 ` Bart Van Assche
2017-09-05 1:40 ` Bart Van Assche
2017-09-05 2:23 ` Ming Lei
2017-09-08 3:08 ` Ming Lei
2017-09-08 17:28 ` Bart Van Assche
2017-09-08 17:28 ` Bart Van Assche
2017-09-09 7:21 ` Ming Lei
2017-09-02 13:08 ` [PATCH V3 8/8] SCSI: preempt freeze block queue when SCSI device is put into quiesce Ming Lei
2017-09-02 14:47 ` Oleksandr Natalenko [this message]
2017-09-02 14:47 ` [PATCH V3 0/8] block/scsi: safe SCSI quiescing Oleksandr Natalenko
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=9524396.xaYzBpxu59@natalenko.name \
--to=oleksandr@natalenko.name \
--cc=axboe@fb.com \
--cc=bart.vanassche@sandisk.com \
--cc=hch@infradead.org \
--cc=jejb@linux.vnet.ibm.com \
--cc=jthumshirn@suse.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@redhat.com \
--cc=tj@kernel.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 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.