From: Dan Williams <dan.j.williams@intel.com>
To: Ira Weiny <ira.weiny@intel.com>, Matthew Wilcox <willy@infradead.org>
Cc: Dan Williams <dan.j.williams@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Alison Schofield" <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
<linux-kernel@vger.kernel.org>, <linux-cxl@vger.kernel.org>,
<linux-pci@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>
Subject: Re: [RFC PATCH 1/3] xarray: Introduce devm_xa_init()
Date: Thu, 14 Jul 2022 08:44:00 -0700 [thread overview]
Message-ID: <62d039c0cfc13_16fb972943f@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <YshGSgHiAiu9QwiZ@iweiny-desk3>
Ira Weiny wrote:
> On Fri, Jul 08, 2022 at 03:53:50PM +0100, Matthew Wilcox wrote:
> > On Tue, Jul 05, 2022 at 04:21:57PM -0700, ira.weiny@intel.com wrote:
> > > The main issue I see with this is defining devm_xa_init() in device.h.
> > > This makes sense because a device is required to use the call. However,
> > > I'm worried about if users will find the call there vs including it in
> > > xarray.h?
> >
> > Honestly, I don't want users to find it. This only makes sense if you're
> > already bought in to the devm cult. I worry people will think that
> > they don't need to do anything else; that everything will be magically
> > freed for them, and we'll leak the objects pointed to from the xarray.
> > I don't even like having xa_destroy() in the API, because of exactly this.
> >
>
> Fair enough. Are you ok with the concept though?
I came here to same the same thing as Matthew. devm_xa_init() does not
lessen review burden like other devm helpers. A reviewer still needs to
go verfy that the patch that uses this makes sure to free all objects in
the xarray before it gets destroyed.
If there still needs to be an open-coded "empty the xarray" step, then
that can just do the xa_destroy() there. So for me, no, the concept of
this just not quite jive.
next prev parent reply other threads:[~2022-07-14 15:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-05 23:21 [RFC PATCH 0/3] Introduce devm_xa_init ira.weiny
2022-07-05 23:21 ` [RFC PATCH 1/3] xarray: Introduce devm_xa_init() ira.weiny
2022-07-07 16:10 ` Bjorn Helgaas
2022-07-08 14:51 ` Ira Weiny
2022-07-08 14:53 ` Matthew Wilcox
2022-07-08 14:59 ` Ira Weiny
2022-07-08 15:21 ` Matthew Wilcox
2022-07-14 15:44 ` Dan Williams [this message]
2022-07-14 16:02 ` Ira Weiny
2022-07-05 23:21 ` [RFC PATCH 2/3] pci/doe: Use devm_xa_init() ira.weiny
2022-07-07 16:06 ` Bjorn Helgaas
2022-07-08 14:45 ` Ira Weiny
2022-07-08 14:49 ` Matthew Wilcox
2022-07-08 14:57 ` Ira Weiny
2022-07-08 15:04 ` Matthew Wilcox
2022-07-08 15:49 ` Ira Weiny
2022-07-05 23:21 ` [RFC PATCH 3/3] CXL/doe: " ira.weiny
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=62d039c0cfc13_16fb972943f@dwillia2-xfh.jf.intel.com.notmuch \
--to=dan.j.williams@intel.com \
--cc=alison.schofield@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=vishal.l.verma@intel.com \
--cc=willy@infradead.org \
/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).