mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Z qiang <qiang.zhang1211@gmail.com>
Cc: jiangshanlai@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] workqueue: Use the kmem_cache_free() instead of kfree() to release pwq
Date: Tue, 10 Oct 2023 08:47:05 -1000	[thread overview]
Message-ID: <ZSWcKUQG_e3sAsZu@slm.duckdns.org> (raw)
In-Reply-To: <CALm+0cUU3nvzk-A6+4zF5fCrkQ_dDY6GE81L97qU-xyCHCsaww@mail.gmail.com>

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

      reply	other threads:[~2023-10-10 18:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-07 11:35 Zqiang
2023-10-09 16:46 ` Tejun Heo
2023-10-10  2:53   ` Z qiang
2023-10-10 18:47     ` Tejun Heo [this message]

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=ZSWcKUQG_e3sAsZu@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qiang.zhang1211@gmail.com \
    /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

all inboxes | Powered by JetHome®