From: Ming Lei <ming.lei@redhat.com>
To: Oleksandr Natalenko <oleksandr@natalenko.name>
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>
Subject: Re: [PATCH 0/9] block/scsi: safe SCSI quiescing
Date: Fri, 1 Sep 2017 11:45:33 +0800 [thread overview]
Message-ID: <20170901034532.GD16525@ming.t460p> (raw)
In-Reply-To: <14328863.IIXMb7O2AM@natalenko.name>
On Thu, Aug 31, 2017 at 08:31:54PM +0200, Oleksandr Natalenko wrote:
> Tested against v4.13-rc7. With this patchset it looks like I/O doesn't hang,
> but once (just once, not each time) I've got the following stacktrace on
> resume:
That looks not bad, and thanks for your test!
Could you try the following patch against this patchset to see
if there is still the warning?
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index b9ad8aeb456f..bbd85ddad18c 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -243,11 +243,12 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
struct request *req;
struct scsi_request *rq;
int ret = DRIVER_ERROR << 24;
+ unsigned flag = sdev->sdev_state == SDEV_QUIESCE ? BLK_REQ_PREEMPT : 0;
req = __blk_get_request(sdev->request_queue,
data_direction == DMA_TO_DEVICE ?
REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, __GFP_RECLAIM,
- BLK_REQ_PREEMPT);
+ flag);
if (IS_ERR(req))
return ret;
rq = scsi_req(req);
@@ -2931,11 +2932,6 @@ EXPORT_SYMBOL(scsi_device_quiesce);
*/
void scsi_device_resume(struct scsi_device *sdev)
{
- /* wait for completion of IO issued during SCSI quiese */
- blk_freeze_queue_wait(sdev->request_queue);
-
- blk_unfreeze_queue(sdev->request_queue);
-
/* check if the device state was mutated prior to resume, and if
* so assume the state is being managed elsewhere (for example
* device deleted during suspend)
@@ -2945,6 +2941,11 @@ void scsi_device_resume(struct scsi_device *sdev)
scsi_device_set_state(sdev, SDEV_RUNNING) == 0)
scsi_run_queue(sdev->request_queue);
mutex_unlock(&sdev->state_mutex);
+
+ /* wait for completion of IO issued during SCSI quiese */
+ blk_freeze_queue_wait(sdev->request_queue);
+
+ blk_unfreeze_queue(sdev->request_queue);
}
EXPORT_SYMBOL(scsi_device_resume);
--
Ming
next prev parent reply other threads:[~2017-09-01 3:45 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-31 17:27 [PATCH 0/9] block/scsi: safe SCSI quiescing Ming Lei
2017-08-31 17:27 ` [PATCH 1/9] percpu-refcount: introduce percpu_ref_is_dead() Ming Lei
2017-08-31 23:07 ` Bart Van Assche
2017-08-31 23:07 ` Bart Van Assche
2017-09-01 3:49 ` Ming Lei
2017-09-01 13:59 ` Tejun Heo
2017-09-01 15:44 ` Bart Van Assche
2017-09-01 15:44 ` Bart Van Assche
2017-09-01 16:05 ` Ming Lei
2017-08-31 17:27 ` [PATCH 2/9] blk-mq: rename blk_mq_unfreeze_queue as blk_unfreeze_queue Ming Lei
2017-08-31 17:27 ` [PATCH 3/9] blk-mq: rename blk_mq_freeze_queue as blk_freeze_queue Ming Lei
2017-08-31 22:35 ` Bart Van Assche
2017-08-31 22:35 ` Bart Van Assche
2017-09-01 3:51 ` Ming Lei
2017-08-31 17:27 ` [PATCH 4/9] blk-mq: only run hw queues for blk-mq Ming Lei
2017-09-01 8:16 ` Johannes Thumshirn
2017-09-01 8:16 ` Johannes Thumshirn
2017-09-01 12:33 ` Ming Lei
2017-09-01 12:44 ` Johannes Thumshirn
2017-09-01 12:44 ` Johannes Thumshirn
2017-08-31 17:27 ` [PATCH 5/9] block: introduce blk_drain_queue() Ming Lei
2017-08-31 22:34 ` Bart Van Assche
2017-08-31 22:34 ` Bart Van Assche
2017-09-01 3:52 ` Ming Lei
2017-08-31 17:27 ` [PATCH 6/9] blk-mq: rename blk_mq_freeze_queue_wait as blk_freeze_queue_wait Ming Lei
2017-08-31 22:37 ` Bart Van Assche
2017-08-31 22:37 ` Bart Van Assche
2017-09-01 3:53 ` Ming Lei
2017-08-31 17:27 ` [PATCH 7/9] block: tracking request allocation with q_usage_counter Ming Lei
2017-08-31 17:27 ` [PATCH 8/9] block: allow to allocate req with REQF_PREEMPT when queue is frozen Ming Lei
2017-08-31 22:50 ` Bart Van Assche
2017-08-31 22:50 ` Bart Van Assche
2017-09-01 3:55 ` Ming Lei
2017-09-01 15:43 ` Bart Van Assche
2017-09-01 15:43 ` Bart Van Assche
2017-09-01 16:56 ` Ming Lei
2017-08-31 17:27 ` [PATCH 9/9] SCSI: freeze block queue when SCSI device is put into quiesce Ming Lei
2017-08-31 17:34 ` [PATCH 0/9] block/scsi: safe SCSI quiescing Oleksandr Natalenko
2017-08-31 17:34 ` Oleksandr Natalenko
2017-08-31 17:38 ` Ming Lei
2017-08-31 18:31 ` Oleksandr Natalenko
2017-08-31 18:31 ` Oleksandr Natalenko
2017-09-01 3:45 ` Ming Lei [this message]
2017-09-01 6:24 ` oleksandr
2017-09-01 6:30 ` 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=20170901034532.GD16525@ming.t460p \
--to=ming.lei@redhat.com \
--cc=axboe@fb.com \
--cc=bart.vanassche@sandisk.com \
--cc=hch@infradead.org \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=oleksandr@natalenko.name \
/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.