From: Christoph Hellwig <hch@lst.de>
To: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Cc: "kbusch@kernel.org" <kbusch@kernel.org>,
Logan Gunthorpe <logang@deltatee.com>,
Christoph Hellwig <hch@lst.de>,
"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
"sagi@grimberg.me" <sagi@grimberg.me>
Subject: Re: [PATCH 1/3] nvme: decouple nvme_ctrl_get_by_path()
Date: Tue, 8 Sep 2020 10:49:58 +0200 [thread overview]
Message-ID: <20200908084958.GA17413@lst.de> (raw)
In-Reply-To: <BYAPR04MB4965438594B46644D7A35AC3862A0@BYAPR04MB4965.namprd04.prod.outlook.com>
On Sat, Sep 05, 2020 at 10:57:42PM +0000, Chaitanya Kulkarni wrote:
> On 9/5/20 00:20, Christoph Hellwig wrote:
> >> I still don't really like this idea. No need to keep a reference to a
> >> whole other file.
>
> File reference open/close is coupled with ctrl refcnt and module refcnt.
> What is a problem with keeping the file reference open ?
>
> > We could still lift the filp_open into the caller, but drop the file
> > reference right after we got the controller reference.
> >
>
> The file open call gets the ctrl and module reference atomically and on
> close release the module and ctrl reference respectively.
>
> If dropping the file reference means closing the file then it will lead
> to loosing the module and ctrl reference.
Not if you grab an extra reference before closing it.
> That also means, moving the references get/put out of
> nvme_dev_open()/nvme_dev_release() in host-core, it will fix the problem
> only for the passthru case. Having done it in the core takes care of the
> all the cases if any.
I don't see why that is an either/or instead of doing both.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2020-09-08 8:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-04 2:39 [PATCH 0/3] nvme: fix module ref count Oops Chaitanya Kulkarni
2020-09-04 2:39 ` [PATCH 1/3] nvme: decouple nvme_ctrl_get_by_path() Chaitanya Kulkarni
2020-09-04 15:54 ` Logan Gunthorpe
2020-09-05 7:20 ` Christoph Hellwig
2020-09-05 22:57 ` Chaitanya Kulkarni
2020-09-08 8:49 ` Christoph Hellwig [this message]
2020-09-08 15:36 ` Logan Gunthorpe
2020-09-04 2:39 ` [PATCH 2/3] nvme: move get/put ctrl into dev open/release Chaitanya Kulkarni
2020-09-04 15:55 ` Logan Gunthorpe
2020-09-08 8:52 ` Christoph Hellwig
2020-09-04 2:39 ` [PATCH 3/3] nvme-core: fix nvme module ref count Oops Chaitanya Kulkarni
2020-09-04 15:57 ` Logan Gunthorpe
2020-09-05 22:03 ` Chaitanya Kulkarni
2020-09-08 15:33 ` Logan Gunthorpe
2020-09-08 8:54 ` Christoph Hellwig
2020-09-08 8:54 ` Christoph Hellwig
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=20200908084958.GA17413@lst.de \
--to=hch@lst.de \
--cc=Chaitanya.Kulkarni@wdc.com \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=logang@deltatee.com \
--cc=sagi@grimberg.me \
/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).