From: james_p_freyensee@linux.intel.com (J Freyensee)
Subject: [PATCH 2/2] nvme-rdma: move admin queue cleanup to nvme_rdma_free_ctrl
Date: Thu, 14 Jul 2016 10:09:06 -0700 [thread overview]
Message-ID: <1468516146.4105.41.camel@linux.intel.com> (raw)
In-Reply-To: <1468478346.28573.1.camel@kernel.org>
On Wed, 2016-07-13@23:39 -0700, Ming Lin wrote:
> On Wed, 2016-07-13@16:59 -0700, J Freyensee wrote:
> > On Wed, 2016-07-13@16:36 -0700, Ming Lin wrote:
> > > On Wed, Jul 13, 2016 at 4:19 PM, J Freyensee
> > > <james_p_freyensee@linux.intel.com> wrote:
> > > >
> > > > > static void nvme_rdma_free_ctrl(struct nvme_ctrl *nctrl)
> > > > > @@ -687,6 +684,10 @@ static void nvme_rdma_free_ctrl(struct
> > > > > nvme_ctrl
> > > > > *nctrl)
> > > > > list_del(&ctrl->list);
> > > > > mutex_unlock(&nvme_rdma_ctrl_mutex);
> > > > >
> > > > > + blk_cleanup_queue(ctrl->ctrl.admin_q);
> > > > > + blk_mq_free_tag_set(&ctrl->admin_tag_set);
> > > > > + nvme_rdma_dev_put(ctrl->device);
> > > > > +
> > > > > if (ctrl->ctrl.tagset) {
> > > > > blk_cleanup_queue(ctrl->ctrl.connect_q);
> > > > > blk_mq_free_tag_set(&ctrl->tag_set);
> > > >
> > > > This patch does not remove the second
> > > >
> > > > nvme_rdma_dev_put(ctrl->device);
> > > >
> > > > call that happens within the if() statement above if it
> > > > evaluates
> > > > to
> > > > TRUE. Should that have been removed or moved elsewhere?
> > >
> > > Not sure I understand your question.
> > > Did you mean line 694?
> >
> > Yes I mean line 694.
> >
> > >
> > > For discovery controller, there is no IO queues. So ctrl-
> > > > ctrl.tagset
> > > is NULL.
> > >
> > > The first bulk of
> > > "blk_cleanup_queue/blk_mq_free_tag_set/nvme_rdma_dev_put" is for
> > > admin
> > > queue.
> > > And the second is for IO queues.
> >
> > I'm just confused when nvme_free_ctrl() in core.c calls:
> >
> > ctrl->ops->free_ctrl(ctrl);
> >
> > which looks like would be the only call that would free both the
> > admin
> > and I/O rdma queues, why there would be the potential to do a
> > _put()
> > twice in nvme_rdma_free_ctrl() via:
> >
> > nvme_rdma_dev_put(ctrl->device);
> >
> > one for the admin section:
> >
> > 687 blk_cleanup_queue(ctrl>ctrl.admin_q);
> > 688 blk_mq_free_tag_set(&ctrl->admin_tag_set);
> > 689 nvme_rdma_dev_put(ctrl->device);
>
> This put paired with the get in nvme_rdma_configure_admin_queue()
>
> >
> > and one for the I/O section (assuming "if (ctrl->ctrl.tagset)"
> > evaluate
> > s to TRUE in that call):
> >
> > 691 if (ctrl->ctrl.tagset) {
> > 692 blk_cleanup_queue(ctrl->ctrl.connect_q);
> > 693 blk_mq_free_tag_set(&ctrl->tag_set);
> > 694 nvme_rdma_dev_put(ctrl->device);
>
> This put paired with the get in nvme_rdma_create_io_queues()
>
> > 695 }
> >
> >
> > My assumption would be that the correct path for this case would be
> > such that
> >
> > nvme_rdma_dev_put(ctrl->device);
> >
> > would only be called one time, for a single device.
>
> As above, need put for each get.
OK, thanks for the clarification on this.
Would it then be worth to have an if() check around the new admin
logic, as the assumption with the added code is it will always need to
free the admin_queue when called, something like:
if (ctrl->admin_tag_set) {
blk_cleanup_queue(ctrl->ctrl.admin_q);
blk_mq_free_tag_set(&ctrl->admin_tag_set);
nvme_rdma_dev_put(ctrl->device);
}
blk_mq_free_tag_set() does assume its parameter is not NULL.
>
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2016-07-14 17:09 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-13 21:26 [PATCH 0/2] nvme-rdma: device removal crash fixes Ming Lin
2016-07-13 21:26 ` [PATCH 1/2] nvme-rdma: grab reference for device removal event Ming Lin
2016-07-13 21:33 ` Steve Wise
2016-07-13 21:26 ` [PATCH 2/2] nvme-rdma: move admin queue cleanup to nvme_rdma_free_ctrl Ming Lin
2016-07-13 21:33 ` Steve Wise
2016-07-13 23:19 ` J Freyensee
2016-07-13 23:36 ` Ming Lin
2016-07-13 23:59 ` J Freyensee
2016-07-14 6:39 ` Ming Lin
2016-07-14 17:09 ` J Freyensee [this message]
2016-07-14 18:04 ` Ming Lin
2016-07-14 9:15 ` Sagi Grimberg
2016-07-14 9:17 ` Sagi Grimberg
2016-07-14 14:30 ` Steve Wise
2016-07-14 14:44 ` Sagi Grimberg
2016-07-14 14:59 ` Steve Wise
[not found] ` <011301d1dde0$4450e4e0$ccf2aea0$@opengridcomputing.com>
2016-07-14 15:02 ` Steve Wise
2016-07-14 15:26 ` Steve Wise
2016-07-14 21:27 ` Steve Wise
2016-07-15 15:52 ` Steve Wise
2016-07-17 6:01 ` Sagi Grimberg
2016-07-18 14:55 ` Steve Wise
2016-07-18 15:47 ` Steve Wise
2016-07-18 16:34 ` Steve Wise
2016-07-18 18:04 ` Steve Wise
2016-07-13 21:58 ` [PATCH 0/2] nvme-rdma: device removal crash fixes Steve Wise
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=1468516146.4105.41.camel@linux.intel.com \
--to=james_p_freyensee@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).