linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Joel Fernandes <joel@joelfernandes.org>
Subject: Re: [PATCH 3/3] ring_buffer: Use try_cmpxchg instead of cmpxchg
Date: Wed, 1 Mar 2023 11:28:08 -0500	[thread overview]
Message-ID: <20230301112808.73d1e316@gandalf.local.home> (raw)
In-Reply-To: <20230301111850.768f8526@gandalf.local.home>

On Wed, 1 Mar 2023 11:18:50 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> But with gcc 12.2.0 I don't really see the benefit. And I'm worried that
> the side effect of modifying the old variable could cause a bug in the
> future, if it is used after the try_cmpxchg(). At least for the second case.

Actually, I like Joel's recommendation of adding a cmpxchg_succeeded()
function, that does the try_cmpxchg() without needing to save the old
variable. That's my main concern, as it does have that side effect that
could be missed when updating the code.

That would be the best of both worlds ;-)

-- Steve

  reply	other threads:[~2023-03-01 16:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28 17:59 [PATCH 0/3] Improve trace/ring_buffer.c Uros Bizjak
2023-02-28 17:59 ` [PATCH 1/3] ring_buffer: Change some static functions to void Uros Bizjak
2023-02-28 22:55   ` Masami Hiramatsu
2023-03-01  8:46     ` Uros Bizjak
2023-03-01 16:34       ` Steven Rostedt
2023-03-02 23:57         ` Masami Hiramatsu
2023-02-28 17:59 ` [PATCH 2/3] ring_buffer: Change some static functions to bool Uros Bizjak
2023-02-28 17:59 ` [PATCH 3/3] ring_buffer: Use try_cmpxchg instead of cmpxchg Uros Bizjak
2023-02-28 21:43   ` Steven Rostedt
2023-03-01  9:37     ` Uros Bizjak
2023-03-01 15:49       ` Joel Fernandes
2023-03-01 15:50         ` Joel Fernandes
2023-03-01 16:18       ` Steven Rostedt
2023-03-01 16:28         ` Steven Rostedt [this message]
2023-03-01 17:57           ` Uros Bizjak
2023-03-01 18:08           ` Uros Bizjak
2023-03-01 17:16         ` Uros Bizjak
2023-03-01 18:18           ` Steven Rostedt
2023-03-01 18:28             ` Steven Rostedt
2023-03-01 18:37               ` Uros Bizjak
2023-02-28 19:35 ` [PATCH 0/3] Improve trace/ring_buffer.c Steven Rostedt
2023-03-01  8:35   ` Uros Bizjak

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=20230301112808.73d1e316@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=ubizjak@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;
as well as URLs for NNTP newsgroup(s).