Re: [PATCH v5 1/2] rust: add static_key_false

From
Alice Ryhl <aliceryhl@google.com>
Date
2024-08-02 11:12:32
Also in
linux-arch, linux-riscv, lkml, loongarch, rust-for-linux
Reply to
Peter Zijlstra, 2024-08-02
On Fri, Aug 2, 2024 at 11:40 AM Peter Zijlstra [off-list ref] wrote:
On Fri, Aug 02, 2024 at 09:31:27AM +0000, Alice Ryhl wrote:
quoted
Add just enough support for static key so that we can use it from
tracepoints. Tracepoints rely on `static_key_false` even though it is
deprecated, so we add the same functionality to Rust.

It is not possible to use the existing C implementation of
arch_static_branch because it passes the argument `key` to inline
assembly as an 'i' parameter, so any attempt to add a C helper for this
function will fail to compile because the value of `key` must be known
at compile-time.

One disadvantage of this patch is that it introduces a fair amount of
duplicated inline assembly. However, this is a limited and temporary
situation:

1. Most inline assembly has no reason to be duplicated like this. It is
   only needed here due to the use of 'i' parameters.

2. Alice will submit a patch along the lines of [1] that removes the
   duplication. This will happen as a follow-up to this patch series.
You're talking about yourself in the 3rd person?
I'm not sure if commit messages are supposed to be a personal message
from me, or an impersonal description of the patch. I'm happy to
reword.
What's the rush, why not do it right first?
Well for one, this version of the series mostly just makes changes to
the second patch.

But also, maybe I'm being too aggressive about it, but I have large
amounts of out-of-tree code that I've been working on upstreaming, and
it's a lot of work to keep it all up-to-date and rebased. I want to
reduce it as much as I can. I was hoping that I could get the changes
to include/linux/tracepoint.h off my plate, even if more work is
needed on the static_key side of things.

Alice
Thread (6 messages) 6 messages, 3 authors, last reply 2024-08-02
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help