mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Pavlu <petr.pavlu@suse.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH] ring-buffer: Have the buffer update counter be atomic
Date: Fri, 11 Oct 2024 10:05:51 +0200	[thread overview]
Message-ID: <1924e096-916a-4311-a3d5-07d3813f50da@suse.com> (raw)
In-Reply-To: <20241010195849.2f77cc3f@gandalf.local.home>

On 10/11/24 01:58, Steven Rostedt wrote:
> From: Steven Rostedt <rostedt@goodmis.org>
> 
> In order to prevent any subtle races with the buffer update counter,
> change it to an atomic_t. Also, since atomic_t is 32 bits, move its
> location in the ring_buffer_per_cpu structure next to "current_context" as
> that too is only 32 bits (making 64 bit alignment).
> 
> The counter is only used to detect that the buffer has been updated when
> the buffer verifier check is being done. It's not really that important
> that it's atomic or not. But since the updates to the counter are never in
> the fast path, having it be consistent isn't a bad thing.
> 
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> Note, this is based on top of:
> 
>   https://lore.kernel.org/linux-trace-kernel/20240715145141.5528-1-petr.pavlu@suse.com/

Sorry for not replying to your last comment on my patch, I was ill.

The member ring_buffer_per_cpu.cnt is intended to be accessed under the
reader_lock, same as the pages pointer which it is tied to, so this
change shouldn't be strictly needed.

-- 
Thanks,
Petr

  reply	other threads:[~2024-10-11  8:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10 23:58 Steven Rostedt
2024-10-11  8:05 ` Petr Pavlu [this message]
2024-10-11 14:01   ` Steven Rostedt
2024-10-11 14:48     ` Steven Rostedt
2024-10-11 15:20       ` Petr Pavlu
2024-10-11 16:44         ` Steven Rostedt
2024-10-11 16:53         ` 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=1924e096-916a-4311-a3d5-07d3813f50da@suse.com \
    --to=petr.pavlu@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.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

all inboxes | Powered by JetHome®