From: Steven Rostedt <rostedt@goodmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Tom Zanussi <zanussi@kernel.org>
Subject: Re: [PATCH v3] tracing: Move histogram trigger variables from stack to per CPU structure
Date: Mon, 7 Apr 2025 10:47:27 -0400 [thread overview]
Message-ID: <20250407104727.32c1eada@gandalf.local.home> (raw)
In-Reply-To: <20250407111551.507e6e2a683a5028bcf62a2c@kernel.org>
On Mon, 7 Apr 2025 11:15:51 +0900
Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:
> > +static int alloc_hist_pad(void)
> > +{
> > + lockdep_assert_held(&event_mutex);
> > +
> > + if (refcount_read(&hist_pad_ref)) {
> > + refcount_inc(&hist_pad_ref);
>
> nit: If this always runs under event_mutex, do we need to use atomic
> refcount_t?
refcount has a bunch of debugging that will trigger if the refcount
goes bad (negative and such) so that I don't need to add those checks.
Basically, refcount is for refcounting, and this is a ref counter ;-)
It's a slow path, so I don't care about the added overhead from using an
atomic.
>
> Others looks good to me.
>
> Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Thanks!
-- Steve
prev parent reply other threads:[~2025-04-07 14:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-04 18:40 [PATCH v3] tracing: Move histogram trigger variables from stack to per CPU structure Steven Rostedt
2025-04-07 2:15 ` Masami Hiramatsu
2025-04-07 14:47 ` Steven Rostedt [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=20250407104727.32c1eada@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=zanussi@kernel.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