All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche@sandisk.com>
To: Jens Axboe <axboe@fb.com>
Cc: "Christoph Hellwig" <hch@lst.de>,
	"James Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"Mike Snitzer" <snitzer@redhat.com>,
	"Doug Ledford" <dledford@redhat.com>,
	"Keith Busch" <keith.busch@intel.com>,
	"Ming Lei" <tom.leiming@gmail.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Laurence Oberman" <loberman@redhat.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: [PATCH v5 13/14] nvme: Fix a race condition related to stopping queues
Date: Fri, 28 Oct 2016 17:23:19 -0700	[thread overview]
Message-ID: <3a8cc957-ea9e-fe1d-f325-ad9ca1aae8a8@sandisk.com> (raw)
In-Reply-To: <7460e8b2-2cfd-c0d5-7ae7-7f662d89dad3@sandisk.com>

Avoid that nvme_queue_rq() is still running when nvme_stop_queues()
returns.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Christoph Hellwig <hch@lst.de>
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 8403996..fe15d94 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2083,7 +2083,7 @@ void nvme_stop_queues(struct nvme_ctrl *ctrl)
 		queue_flag_set(QUEUE_FLAG_STOPPED, ns->queue);
 		spin_unlock_irq(ns->queue->queue_lock);
 
-		blk_mq_stop_hw_queues(ns->queue);
+		blk_mq_quiesce_queue(ns->queue);
 	}
 	mutex_unlock(&ctrl->namespaces_mutex);
 }
-- 
2.10.1


WARNING: multiple messages have this Message-ID (diff)
From: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
To: Jens Axboe <axboe-b10kYP2dOMg@public.gmane.org>
Cc: "Christoph Hellwig" <hch-jcswGhMUV9g@public.gmane.org>,
	"James Bottomley"
	<jejb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
	"Martin K. Petersen"
	<martin.petersen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	"Mike Snitzer" <snitzer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"Doug Ledford" <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"Keith Busch"
	<keith.busch-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"Ming Lei" <tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"Konrad Rzeszutek Wilk"
	<konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	"Roger Pau Monné"
	<roger.pau-Sxgqhf6Nn4DQT0dZR+AlfA@public.gmane.org>,
	"Laurence Oberman"
	<loberman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: [PATCH v5 13/14] nvme: Fix a race condition related to stopping queues
Date: Fri, 28 Oct 2016 17:23:19 -0700	[thread overview]
Message-ID: <3a8cc957-ea9e-fe1d-f325-ad9ca1aae8a8@sandisk.com> (raw)
In-Reply-To: <7460e8b2-2cfd-c0d5-7ae7-7f662d89dad3-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>

Avoid that nvme_queue_rq() is still running when nvme_stop_queues()
returns.

Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Cc: Keith Busch <keith.busch-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
Cc: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 8403996..fe15d94 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2083,7 +2083,7 @@ void nvme_stop_queues(struct nvme_ctrl *ctrl)
 		queue_flag_set(QUEUE_FLAG_STOPPED, ns->queue);
 		spin_unlock_irq(ns->queue->queue_lock);
 
-		blk_mq_stop_hw_queues(ns->queue);
+		blk_mq_quiesce_queue(ns->queue);
 	}
 	mutex_unlock(&ctrl->namespaces_mutex);
 }
-- 
2.10.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: bart.vanassche@sandisk.com (Bart Van Assche)
Subject: [PATCH v5 13/14] nvme: Fix a race condition related to stopping queues
Date: Fri, 28 Oct 2016 17:23:19 -0700	[thread overview]
Message-ID: <3a8cc957-ea9e-fe1d-f325-ad9ca1aae8a8@sandisk.com> (raw)
In-Reply-To: <7460e8b2-2cfd-c0d5-7ae7-7f662d89dad3@sandisk.com>

Avoid that nvme_queue_rq() is still running when nvme_stop_queues()
returns.

Signed-off-by: Bart Van Assche <bart.vanassche at sandisk.com>
Cc: Keith Busch <keith.busch at intel.com>
Cc: Sagi Grimberg <sagi at grimberg.me>
Cc: Christoph Hellwig <hch at lst.de>
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 8403996..fe15d94 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2083,7 +2083,7 @@ void nvme_stop_queues(struct nvme_ctrl *ctrl)
 		queue_flag_set(QUEUE_FLAG_STOPPED, ns->queue);
 		spin_unlock_irq(ns->queue->queue_lock);
 
-		blk_mq_stop_hw_queues(ns->queue);
+		blk_mq_quiesce_queue(ns->queue);
 	}
 	mutex_unlock(&ctrl->namespaces_mutex);
 }
-- 
2.10.1

  parent reply	other threads:[~2016-10-29  0:23 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-29  0:18 [PATCH v5 0/14] Fix race conditions related to stopping block layer queues Bart Van Assche
2016-10-29  0:18 ` Bart Van Assche
2016-10-29  0:18 ` [PATCH v5 01/14] blk-mq: Do not invoke .queue_rq() for a stopped queue Bart Van Assche
2016-10-29  0:18   ` Bart Van Assche
2016-10-29  0:19 ` [PATCH v5 02/14] blk-mq: Introduce blk_mq_hctx_stopped() Bart Van Assche
2016-10-29  0:19   ` Bart Van Assche
2016-10-29  0:19 ` [PATCH v5 03/14] blk-mq: Introduce blk_mq_queue_stopped() Bart Van Assche
2016-10-29  0:19   ` Bart Van Assche
2016-10-29  0:20 ` [PATCH v5 04/14] blk-mq: Move more code into blk_mq_direct_issue_request() Bart Van Assche
2016-10-29  0:20   ` Bart Van Assche
2016-10-29  0:20 ` [PATCH v5 05/14] blk-mq: Avoid that requeueing starts stopped queues Bart Van Assche
2016-10-29  0:20   ` Bart Van Assche
2016-10-29  0:20   ` Bart Van Assche
2016-11-01 16:01   ` Sagi Grimberg
2016-11-01 16:01     ` Sagi Grimberg
2016-11-01 16:01     ` Sagi Grimberg
2016-10-29  0:20 ` [PATCH v5 06/14] blk-mq: Remove blk_mq_cancel_requeue_work() Bart Van Assche
2016-10-29  0:20   ` Bart Van Assche
2016-10-29  0:20   ` Bart Van Assche
2016-11-01 16:01   ` Sagi Grimberg
2016-11-01 16:01     ` Sagi Grimberg
2016-10-29  0:21 ` [PATCH v5 07/14] blk-mq: Introduce blk_mq_quiesce_queue() Bart Van Assche
2016-10-29  0:21   ` Bart Van Assche
2016-10-29  0:21   ` Bart Van Assche
2016-11-01 16:02   ` Sagi Grimberg
2016-11-01 16:02     ` Sagi Grimberg
2016-11-02  2:08     ` Ming Lei
2016-11-02  2:08       ` Ming Lei
2016-11-02  2:08       ` Ming Lei
2016-10-29  0:21 ` [PATCH v5 08/14] blk-mq: Add a kick_requeue_list argument to blk_mq_requeue_request() Bart Van Assche
2016-10-29  0:21   ` Bart Van Assche
2016-10-29  0:21   ` Bart Van Assche
2016-11-01 16:02   ` Sagi Grimberg
2016-11-01 16:02     ` Sagi Grimberg
2016-10-29  0:22 ` [PATCH v5 09/14] dm: Use BLK_MQ_S_STOPPED instead of QUEUE_FLAG_STOPPED in blk-mq code Bart Van Assche
2016-10-29  0:22   ` Bart Van Assche
2016-10-29  0:22 ` [PATCH v5 10/14] dm: Fix a race condition related to stopping and starting queues Bart Van Assche
2016-10-29  0:22   ` Bart Van Assche
2016-10-29  0:22 ` [PATCH v5 11/14] SRP transport: Move queuecommand() wait code to SCSI core Bart Van Assche
2016-10-29  0:22   ` Bart Van Assche
2016-11-01 16:03   ` Sagi Grimberg
2016-11-01 16:03     ` Sagi Grimberg
2016-11-01 16:11   ` Martin K. Petersen
2016-11-01 16:11     ` Martin K. Petersen
2016-11-01 16:11     ` Martin K. Petersen
2016-10-29  0:23 ` [PATCH v5 12/14] SRP transport, scsi-mq: Wait for .queue_rq() if necessary Bart Van Assche
2016-10-29  0:23   ` Bart Van Assche
2016-11-01 16:03   ` Sagi Grimberg
2016-11-01 16:03     ` Sagi Grimberg
2016-11-01 16:03     ` Sagi Grimberg
2016-11-01 16:12   ` Martin K. Petersen
2016-11-01 16:12     ` Martin K. Petersen
2016-10-29  0:23 ` Bart Van Assche [this message]
2016-10-29  0:23   ` [PATCH v5 13/14] nvme: Fix a race condition related to stopping queues Bart Van Assche
2016-10-29  0:23   ` Bart Van Assche
2016-11-01 16:03   ` Sagi Grimberg
2016-11-01 16:03     ` Sagi Grimberg
2016-10-29  0:23 ` [PATCH v5 14/14] nvme: Use BLK_MQ_S_STOPPED instead of QUEUE_FLAG_STOPPED in blk-mq code Bart Van Assche
2016-10-29  0:23   ` Bart Van Assche
2016-10-31 13:53   ` Laurence Oberman
2016-10-31 13:53     ` Laurence Oberman
2016-10-31 13:59     ` Bart Van Assche
2016-10-31 13:59       ` Bart Van Assche
2016-10-31 13:59       ` Bart Van Assche
2016-10-31 15:10     ` Bart Van Assche
2016-10-31 15:10       ` Bart Van Assche
2016-10-31 15:10       ` Bart Van Assche
2016-11-02 15:17 ` [PATCH v5 0/14] Fix race conditions related to stopping block layer queues Christoph Hellwig
2016-11-02 15:17   ` Christoph Hellwig
2016-11-02 18:52 ` Jens Axboe
2016-11-02 18:52   ` Jens Axboe
2016-11-02 18:52   ` Jens Axboe
2016-11-02 19:35   ` Bart Van Assche
2016-11-02 19:35     ` 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=3a8cc957-ea9e-fe1d-f325-ad9ca1aae8a8@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=axboe@fb.com \
    --cc=dledford@redhat.com \
    --cc=hch@lst.de \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=keith.busch@intel.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=loberman@redhat.com \
    --cc=martin.petersen@oracle.com \
    --cc=roger.pau@citrix.com \
    --cc=snitzer@redhat.com \
    --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 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.