lkml.org 
[lkml]   [2023]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] workqueue: Use the kmem_cache_free() instead of kfree() to release pwq
On Tue, Oct 10, 2023 at 10:53:31AM +0800, Z qiang wrote:
> >
> > On Sat, Oct 07, 2023 at 07:35:41PM +0800, Zqiang wrote:
> > > The pwq objects is allocated by kmem_cache_alloc(), this commit therefore
> > > use kmem_cache_free() instead of kfree() to release pwq objects and also
> > > make use the correct tracepoint("trace_kmem_cache_free") to trace the
> > > release of pwq.
> >
> > This isn't wrong. kfree() can be used for memory allocated with
> > kmem_cache_alloc().
> >
>
> Yes, that's not wrong. but pwq is allocated by kmem_cache_alloc(),
> usually should use kmem_cache_free() to release, correspondingly, we can
> use 'trace_kmem_cache_alloc/trace_kmem_cache_free' to track, not using
> 'trace_kmem_cache_alloc/trace_kfree'.
> And in rcu_free_pwq(), we use kmem_cache_free() to free pwq.

Can you please update the patch description to clarify that the code is
currently not broken but it's trying to make it nicer by unifying how
they're freed?

Thanks.

--
tejun

\
 
 \ /
  Last update: 2023-10-10 20:48    [W:0.093 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site