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 13:18:31 -0500 [thread overview]
Message-ID: <20230301131831.6c8d4ff5@gandalf.local.home> (raw)
In-Reply-To: <CAFULd4YePGAqxpq0kJMnNHkqqkL9HEnEz1ud9kNrae5wqpRVbA@mail.gmail.com>
On Wed, 1 Mar 2023 18:16:04 +0100
Uros Bizjak <ubizjak@gmail.com> wrote:
> > It's different, but I'm not so sure it's beneficial.
>
> This is the place we are looking for. Please see that a move at $1464
> and a compare at $1473 is missing in the assembly from the patched
> code. If it is beneficial ... well, we achieved the same result with
> two instructions less in a loopy code.
Note, none of these locations are in fast paths. (now if we had a
local_try_cmpxchg() then we could improve those locations!).
Thus my main concern here is for correctness. Unfortunately, to add a
cmpxchg_success() would require a lot of work, as all the cmpxchg()
functions are really macros that do a lot of magic (the
include/linux/atomic/atomic-instrumented.h says its even generated!). So
that will likely not happen.
I have mixed feelings for this patch. I like the fact that you are looking
in optimizing the code, but I'm also concerned that it could cause issues
later down the road.
I am leaning to just taking this, and hope that it doesn't cause problems.
And I would really love to change all the local_cmpxchg() to
local_try_cmpxchg(). Hmm, I wonder how much of an effort that would be to
implement those?
-- Steve
next prev parent reply other threads:[~2023-03-01 18:18 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
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 [this message]
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=20230301131831.6c8d4ff5@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
all inboxes | Powered by JetHome®