Linux Trace Kernel
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: LKML <linux-kernel@vger.kernel.org>,
	Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Tom Zanussi <zanussi@kernel.org>
Subject: Re: [PATCH] tracing: Move histogram trigger variables from stack to per CPU structure
Date: Fri, 4 Apr 2025 09:58:41 -0400	[thread overview]
Message-ID: <20250404095841.2cac7a47@gandalf.local.home> (raw)
In-Reply-To: <20250403204251.0164a4cf@gandalf.local.home>

On Thu, 3 Apr 2025 20:42:51 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> +static struct hist_pad *get_hist_pad(void)
> +{
> +	struct hist_pad *hist_pad;
> +	int cnt;
> +
> +	preempt_disable();
> +	hist_pad = per_cpu_ptr(hist_pads, smp_processor_id());
> +	if (!hist_pad)
> +		goto out_fail;

Hmm, this is incorrect. hist_pads can be NULL or allocated, so the check
should be:

	if (!hist_pads)
		goto fail;
	hist_pad = per_cpu_ptr(hist_pads, smp_processor_id());

Will send v2.

-- Steve


> +
> +	if (this_cpu_read(hist_pad_cnt) == MAX_HIST_CNT)
> +		goto out_fail;
> +
> +	cnt = this_cpu_inc_return(hist_pad_cnt) - 1;
> +
> +	return &hist_pad[cnt];
> +

  reply	other threads:[~2025-04-04 13:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-04  0:42 [PATCH] tracing: Move histogram trigger variables from stack to per CPU structure Steven Rostedt
2025-04-04 13:58 ` Steven Rostedt [this message]
2025-04-04 14:04   ` Steven Rostedt

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=20250404095841.2cac7a47@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