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

From
Peter Zijlstra <peterz@infradead.org>
Date
2024-08-02 09:40:19
Also in
linux-arch, linux-riscv, lkml, loongarch, rust-for-linux
Reply to
Alice Ryhl, 2024-08-02
On Fri, Aug 02, 2024 at 09:31:27AM +0000, Alice Ryhl wrote:
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?

What's the rush, why not do it right first?
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