[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZjoDL6EkDcRf6hML@bogus>
Date: Tue, 7 May 2024 11:32:15 +0100
From: Sudeep Holla <sudeep.holla@....com>
To: Vincenzo Mezzela <vincenzo.mezzela@...il.com>
Cc: Greg KH <gregkh@...uxfoundation.org>, javier.carrasco.cruz@...il.com,
Sudeep Holla <sudeep.holla@....com>, julia.lawall@...ia.fr,
linux-kernel@...r.kernel.org, rafael@...nel.org,
skhan@...uxfoundation.org, conor@...nel.org
Subject: Re: [PATCH 2/2 v3] drivers: use __free attribute instead of
of_node_put()
On Mon, May 06, 2024 at 05:30:49PM +0200, Vincenzo Mezzela wrote:
>
> On 01/05/24 15:06, Greg KH wrote:
> > On Wed, May 01, 2024 at 02:33:39PM +0200, Vincenzo Mezzela wrote:
> > > On 01/05/24 12:48, Greg KH wrote:
> > > > On Wed, May 01, 2024 at 11:43:13AM +0200, Vincenzo Mezzela wrote:
> > > > > Introduce the __free attribute for scope-based resource management.
> > > > > Resources allocated with __free are automatically released at the end of
> > > > > the scope. This enhancement aims to mitigate memory management issues
> > > > > associated with forgetting to release resources by utilizing __free
> > > > > instead of of_node_put().
> > > > >
> > > > > The declaration of the device_node used within the do-while loops is
> > > > > moved directly within the loop so that the resource is automatically
> > > > > freed at the end of each iteration.
> > > > >
> > > > > Suggested-by: Julia Lawall <julia.lawall@...ia.fr>
> > > > > Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@...il.com>
> > > > > ---
> > > > > drivers/base/arch_topology.c | 51 +++++++++++++++---------------------
> > > > > 1 file changed, 21 insertions(+), 30 deletions(-)
> > > > How was all of this tested?
> > > >
> > > > thanks,
> > > >
> > > > greg k-h
> > > Hi,
> > >
> > > I just cross-compiled it for RISC-V to enable the config
> > > GENERIC_ARCH_TOPOLOGY
> > > and include arch_topology.c as well.
> > Cross-compile is nice, how about running it?
> >
> > > Do you have any suggestion to trigger the affected code and perform some
> > > testing?
> > That is up to you to determine if you wish to modify it :)
> >
> > thanks,
> >
> > greg k-h
> Hi,
>
> I've successfully run it on QEMU. There are no differences in the dmesg
> after applying the patches.
>
For this patch, dmesg delta may not be of any use.
> Furthermore, I've tracked the execution of the parse_dt_topology() which is
> calling all the functions that I've modified with the patches and I checked
> that of_node_put was correctly called at the end of each scope.
>
That should be good enough.
> Is there anything else that can be done to further testing this changes?
>
I don't think there is much we can test other than what you have done already.
If you fix the subject and any other comments me and others had suggested, I
am happy to Ack.
--
Regards,
Sudeep
Powered by blists - more mailing lists