[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6931ebd626df6_1e021001d@dwillia2-mobl4.notmuch>
Date: Thu, 4 Dec 2025 12:15:18 -0800
From: <dan.j.williams@...el.com>
To: Dave Jiang <dave.jiang@...el.com>, Dan Williams <dan.j.williams@...el.com>
CC: <linux-cxl@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<Smita.KoralahalliChannabasappa@....com>, <alison.schofield@...el.com>,
<terry.bowman@....com>, <alejandro.lucero-palau@....com>,
<linux-pci@...r.kernel.org>, <Jonathan.Cameron@...wei.com>, Shiju Jose
<shiju.jose@...wei.com>
Subject: Re: [PATCH 1/6] cxl/mem: Fix devm_cxl_memdev_edac_release() confusion
Dave Jiang wrote:
>
>
> On 12/3/25 7:21 PM, Dan Williams wrote:
> > A device release method is only for undoing allocations on the path to
> > preparing the device for device_add(). In contrast, devm allocations are
> > post device_add(), are acquired during / after ->probe() and are released
> > synchronous with ->remove().
> >
> > So, a "devm" helper in a "release" method is a clear anti-pattern.
> >
> > Move this devm release action where it belongs, an action created at edac
> > object creation time. Otherwise, this leaks resources until
> > cxl_memdev_release() time which may be long after these xarray and error
> > record caches have gone idle.
> >
> > Note, this also fixes up the type of @cxlmd->err_rec_array which needlessly
> > dropped type-safety.
> >
> > Fixes: 0b5ccb0de1e2 ("cxl/edac: Support for finding memory operation attributes from the current boot")
> > Cc: Dave Jiang <dave.jiang@...el.com>
> > Cc: Jonathan Cameron <Jonathan.Cameron@...wei.com>
> > Cc: Shiju Jose <shiju.jose@...wei.com>
> > Cc: Alison Schofield <alison.schofield@...el.com>
> > Signed-off-by: Dan Williams <dan.j.williams@...el.com>
>
> Reviewed-by: Dave Jiang <dave.jiang@...el.com>
>
> This can go into fixes right? Does not look like a dependency for the rest of the series.
It could go into fixes, but until someone reports a practical problem
the urgency is low. The impacts of the leak are minor especially on
typical builds where CONFIG_DEBUG_KOBJECT_RELEASE is disabled. The main
motivation to push it along is to interdict any further attempts to make
the "release" vs "devm" mistake.
Powered by blists - more mailing lists