From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 In-Reply-To: <67c17f61-e225-74ce-5803-8452c987a6a0@grimberg.me> References: <1499154912-10420-1-git-send-email-sagi@grimberg.me> <1499154912-10420-4-git-send-email-sagi@grimberg.me> <20170704082232.GE29053@ming.t460p> <67c17f61-e225-74ce-5803-8452c987a6a0@grimberg.me> From: Ming Lei Date: Tue, 4 Jul 2017 18:38:45 +0800 Message-ID: Subject: Re: [PATCH 3/8] nvme-loop: quiesce admin_q instead of stopping hw queues To: Sagi Grimberg Cc: linux-nvme , Ming Lei , Keith Busch , Jens Axboe , Christoph Hellwig , linux-block@vger.kernel.org Content-Type: multipart/alternative; boundary="089e08208e98f748bc05537b7cfd" List-ID: --089e08208e98f748bc05537b7cfd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2017=E5=B9=B47=E6=9C=884=E6=97=A5 =E4=B8=8B=E5=8D=885:25=EF=BC=8C"Sagi Grim= berg" =E5=86=99=E9=81=93=EF=BC=9A diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c >> index 3d51341e62ee..891002ee005f 100644 >> --- a/drivers/nvme/target/loop.c >> +++ b/drivers/nvme/target/loop.c >> @@ -434,7 +434,7 @@ static void nvme_loop_shutdown_ctrl(struct >> nvme_loop_ctrl *ctrl) >> if (ctrl->ctrl.state =3D=3D NVME_CTRL_LIVE) >> nvme_shutdown_ctrl(&ctrl->ctrl); >> - blk_mq_stop_hw_queues(ctrl->ctrl.admin_q); >> + blk_mq_quiesce_queue(ctrl->ctrl.admin_q); >> blk_mq_tagset_busy_iter(&ctrl->admin_tag_set, >> nvme_cancel_request, &ctrl->ctrl); >> nvme_loop_destroy_admin_queue(ctrl); >> > > Is the queue killed before calling nvme_loop_destroy_admin_queue()? > No, its not. If not, simply quiescing and not unquiescing will hang in > blk_cleanup_queue(). > Why should it? blk_cleanup_queue does not hang, even under IO load... After queue is quiesced, new req still can come in and be put into sw queue or scheduler queue, then these requests can't be submitted and completed at all, finally cleanup never returns. --089e08208e98f748bc05537b7cfd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


2017=E5=B9=B47=E6=9C=884=E6=97=A5 =E4=B8=8B=E5=8D=885:25=EF=BC=8C= "Sagi Grimberg" <sagi@grim= berg.me>=E5=86=99=E9=81=93=EF=BC=9A
=
diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
index 3d51341e62ee..891002ee005f 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -434,7 +434,7 @@ static void nvme_loop_shutdown_ctrl(struct nvme_loop_ct= rl *ctrl)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ctrl->ctrl.state =3D=3D NVME_CTRL_LIVE)<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nvme_shutdown_ctrl(= &ctrl->ctrl);
=C2=A0 -=C2=A0 =C2=A0 =C2=A0blk_mq_stop_hw_queues(ctrl->ctrl.admin_= q);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0blk_mq_quiesce_queue(ctrl->ctrl.admin_q= );
=C2=A0 =C2=A0 =C2=A0 =C2=A0 blk_mq_tagset_busy_iter(&ctrl->admi= n_tag_set,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nvme_cancel_request, &ctrl->c= trl);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 nvme_loop_destroy_admin_queue(ctrl);

Is the queue killed before calling nvme_loop_destroy_admin_queue()?

No, its not.


If not, simply quiescing and not unquiescing will hang in
blk_cleanup_queue().

Why should it? blk_cleanup_queue does not hang, even under IO load...

Afte= r queue is quiesced, new req still can come in and be put into
sw queue or scheduler queue,=C2=A0
then t= hese requests can't be
submitted and completed a= t all,
finally cleanup never returns.

--089e08208e98f748bc05537b7cfd--