From: Bart Van Assche <bart.vanassche@wdc.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
=Oleksandr Natalenko <oleksandr@natalenko.name>,
Bart Van Assche <bart.vanassche@wdc.com>,
Ming Lei <ming.lei@redhat.com>, Hannes Reinecke <hare@suse.com>,
Johannes Thumshirn <jthumshirn@suse.de>
Subject: [PATCH v2 4/4] scsi-mq: Reduce suspend latency
Date: Thu, 21 Sep 2017 14:22:55 -0700 [thread overview]
Message-ID: <20170921212255.12788-5-bart.vanassche@wdc.com> (raw)
In-Reply-To: <20170921212255.12788-1-bart.vanassche@wdc.com>
Avoid that it can take 200 ms too long to wait for ongoing requests
to finish. Note: blk_mq_freeze_queue() uses a wait queue to wait
for ongoing requests to finish.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
---
drivers/scsi/scsi_lib.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index e76fd6e89a81..34e5f0f95d01 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2901,10 +2901,15 @@ scsi_device_quiesce(struct scsi_device *sdev)
if (err)
return err;
- scsi_run_queue(q);
- while (atomic_read(&sdev->device_busy)) {
- msleep_interruptible(200);
+ if (q->mq_ops) {
+ blk_mq_freeze_queue(q);
+ blk_mq_unfreeze_queue(q);
+ } else {
scsi_run_queue(q);
+ while (atomic_read(&sdev->device_busy)) {
+ msleep_interruptible(200);
+ scsi_run_queue(q);
+ }
}
return 0;
}
--
2.14.1
next prev parent reply other threads:[~2017-09-21 21:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-21 21:22 [PATCH v2 0/4] Make SCSI device suspend and resume work reliably Bart Van Assche
2017-09-21 21:22 ` [PATCH v2 1/4] block: Convert RQF_PREEMPT into REQ_PREEMPT Bart Van Assche
2017-09-21 21:22 ` [PATCH v2 2/4] block: Add the QUEUE_PREEMPT_ONLY request queue flag Bart Van Assche
2017-09-21 21:22 ` [PATCH v2 3/4] block, scsi: Make SCSI device suspend and resume work reliably Bart Van Assche
2017-09-21 22:04 ` Ming Lei
2017-09-21 22:44 ` Bart Van Assche
2017-09-21 21:22 ` Bart Van Assche [this message]
2017-09-21 22:06 ` [PATCH v2 4/4] scsi-mq: Reduce suspend latency Ming Lei
2017-09-21 22:43 ` Bart Van Assche
2017-09-21 23:25 ` Ming Lei
2017-09-21 23:32 ` Bart Van Assche
2017-09-21 23:53 ` Ming Lei
2017-09-21 23:56 ` Bart Van Assche
2017-09-22 0:03 ` 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=20170921212255.12788-5-bart.vanassche@wdc.com \
--to=bart.vanassche@wdc.com \
--cc=axboe@kernel.dk \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=jthumshirn@suse.de \
--cc=linux-block@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@redhat.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.