* [PATCH] rust: sync: completion: mark inline complete_all and wait_for_completion
@ 2026-03-16 8:21 Fabricio
2026-03-16 10:51 ` Gary Guo
0 siblings, 1 reply; 6+ messages in thread
From: Fabricio @ 2026-03-16 8:21 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
rust-for-linux, linux-kernel, Fabricio Parra
From: Fabricio Parra <a@alice0.com>
When building the kernel using the llvm-22.1.0-rust-1.93.1-x86_64
toolchain provided by kernel.org with ARCH=x86_64, the following symbols
are generated:
$ nm vmlinux | grep ' _R'.*Completion | rustfilt
ffffffff81827930 T <kernel::sync::completion::Completion>::complete_all
ffffffff81827950 T <kernel::sync::completion::Completion>::wait_for_completion
These Rust methods are thin wrappers around the C completion helpers
`complete_all` and `wait_for_completion`. Mark them `#[inline]` to keep
the wrapper pattern consistent with other small Rust helper methods.
After applying this patch, the above command will produce no output.
Link: https://github.com/Rust-for-Linux/linux/issues/1145
Suggested-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Fabricio Parra <a@alice0.com>
---
rust/kernel/sync/completion.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/rust/kernel/sync/completion.rs b/rust/kernel/sync/completion.rs
index c50012a940a3..35ff049ff078 100644
--- a/rust/kernel/sync/completion.rs
+++ b/rust/kernel/sync/completion.rs
@@ -94,6 +94,7 @@ fn as_raw(&self) -> *mut bindings::completion {
///
/// This method wakes up all tasks waiting on this completion; after this operation the
/// completion is permanently done, i.e. signals all current and future waiters.
+ #[inline]
pub fn complete_all(&self) {
// SAFETY: `self.as_raw()` is a pointer to a valid `struct completion`.
unsafe { bindings::complete_all(self.as_raw()) };
@@ -105,6 +106,7 @@ pub fn complete_all(&self) {
/// timeout.
///
/// See also [`Completion::complete_all`].
+ #[inline]
pub fn wait_for_completion(&self) {
// SAFETY: `self.as_raw()` is a pointer to a valid `struct completion`.
unsafe { bindings::wait_for_completion(self.as_raw()) };
base-commit: 79e25710e7227228902d672417b552dd1d7e5d3b
--
2.53.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] rust: sync: completion: mark inline complete_all and wait_for_completion
2026-03-16 8:21 [PATCH] rust: sync: completion: mark inline complete_all and wait_for_completion Fabricio
@ 2026-03-16 10:51 ` Gary Guo
2026-03-16 14:39 ` A.L.I.C.E
2026-03-16 15:10 ` [PATCH v2] " Fabricio Parra
0 siblings, 2 replies; 6+ messages in thread
From: Gary Guo @ 2026-03-16 10:51 UTC (permalink / raw)
To: Fabricio Parra, Miguel Ojeda
Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
rust-for-linux, linux-kernel, Fabricio Parra
On Mon Mar 16, 2026 at 8:21 AM GMT, wrote:
> From: Fabricio Parra <a@alice0.com>
Your email header is malformed. It has "Fabricio Parra a@alice0.com" in the from
line instead of expected RFC 5322 format. People won't be able to just reply to
this email and get it delivered to your inbox.
Please check and fix your git or email configuration.
Best,
Gary
>
> When building the kernel using the llvm-22.1.0-rust-1.93.1-x86_64
> toolchain provided by kernel.org with ARCH=x86_64, the following symbols
> are generated:
>
> $ nm vmlinux | grep ' _R'.*Completion | rustfilt
> ffffffff81827930 T <kernel::sync::completion::Completion>::complete_all
> ffffffff81827950 T <kernel::sync::completion::Completion>::wait_for_completion
>
> These Rust methods are thin wrappers around the C completion helpers
> `complete_all` and `wait_for_completion`. Mark them `#[inline]` to keep
> the wrapper pattern consistent with other small Rust helper methods.
>
> After applying this patch, the above command will produce no output.
>
> Link: https://github.com/Rust-for-Linux/linux/issues/1145
> Suggested-by: Alice Ryhl <aliceryhl@google.com>
> Signed-off-by: Fabricio Parra <a@alice0.com>
> ---
> rust/kernel/sync/completion.rs | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/rust/kernel/sync/completion.rs b/rust/kernel/sync/completion.rs
> index c50012a940a3..35ff049ff078 100644
> --- a/rust/kernel/sync/completion.rs
> +++ b/rust/kernel/sync/completion.rs
> @@ -94,6 +94,7 @@ fn as_raw(&self) -> *mut bindings::completion {
> ///
> /// This method wakes up all tasks waiting on this completion; after this operation the
> /// completion is permanently done, i.e. signals all current and future waiters.
> + #[inline]
> pub fn complete_all(&self) {
> // SAFETY: `self.as_raw()` is a pointer to a valid `struct completion`.
> unsafe { bindings::complete_all(self.as_raw()) };
> @@ -105,6 +106,7 @@ pub fn complete_all(&self) {
> /// timeout.
> ///
> /// See also [`Completion::complete_all`].
> + #[inline]
> pub fn wait_for_completion(&self) {
> // SAFETY: `self.as_raw()` is a pointer to a valid `struct completion`.
> unsafe { bindings::wait_for_completion(self.as_raw()) };
>
> base-commit: 79e25710e7227228902d672417b552dd1d7e5d3b
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] rust: sync: completion: mark inline complete_all and wait_for_completion
2026-03-16 10:51 ` Gary Guo
@ 2026-03-16 14:39 ` A.L.I.C.E
2026-03-16 15:10 ` [PATCH v2] " Fabricio Parra
1 sibling, 0 replies; 6+ messages in thread
From: A.L.I.C.E @ 2026-03-16 14:39 UTC (permalink / raw)
To: Gary Guo
Cc: Miguel Ojeda, Boqun Feng, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
rust-for-linux, linux-kernel
On Mon, Mar 16, 2026 at 10:51 AM GMT Gary Guo <gary@garyguo.net> wrote:
>
> On Mon Mar 16, 2026 at 8:21 AM GMT, wrote:
> > From: Fabricio Parra <a@alice0.com>
>
> Your email header is malformed. It has "Fabricio Parra a@alice0.com" in the from
> line instead of expected RFC 5322 format. People won't be able to just reply to
> this email and get it delivered to your inbox.
>
> Please check and fix your git or email configuration.
>
> Best,
> Gary
>
My bad, I completely messed up my git-send-email config while I was setting
it up. I'll send a v2 with fixed headers shortly, thank you for pointing it out!
Regards,
Fabricio
> >
> > When building the kernel using the llvm-22.1.0-rust-1.93.1-x86_64
> > toolchain provided by kernel.org with ARCH=x86_64, the following symbols
> > are generated:
> >
> > $ nm vmlinux | grep ' _R'.*Completion | rustfilt
> > ffffffff81827930 T <kernel::sync::completion::Completion>::complete_all
> > ffffffff81827950 T <kernel::sync::completion::Completion>::wait_for_completion
> >
> > These Rust methods are thin wrappers around the C completion helpers
> > `complete_all` and `wait_for_completion`. Mark them `#[inline]` to keep
> > the wrapper pattern consistent with other small Rust helper methods.
> >
> > After applying this patch, the above command will produce no output.
> >
> > Link: https://github.com/Rust-for-Linux/linux/issues/1145
> > Suggested-by: Alice Ryhl <aliceryhl@google.com>
> > Signed-off-by: Fabricio Parra <a@alice0.com>
> > ---
> > rust/kernel/sync/completion.rs | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/rust/kernel/sync/completion.rs b/rust/kernel/sync/completion.rs
> > index c50012a940a3..35ff049ff078 100644
> > --- a/rust/kernel/sync/completion.rs
> > +++ b/rust/kernel/sync/completion.rs
> > @@ -94,6 +94,7 @@ fn as_raw(&self) -> *mut bindings::completion {
> > ///
> > /// This method wakes up all tasks waiting on this completion; after this operation the
> > /// completion is permanently done, i.e. signals all current and future waiters.
> > + #[inline]
> > pub fn complete_all(&self) {
> > // SAFETY: `self.as_raw()` is a pointer to a valid `struct completion`.
> > unsafe { bindings::complete_all(self.as_raw()) };
> > @@ -105,6 +106,7 @@ pub fn complete_all(&self) {
> > /// timeout.
> > ///
> > /// See also [`Completion::complete_all`].
> > + #[inline]
> > pub fn wait_for_completion(&self) {
> > // SAFETY: `self.as_raw()` is a pointer to a valid `struct completion`.
> > unsafe { bindings::wait_for_completion(self.as_raw()) };
> >
> > base-commit: 79e25710e7227228902d672417b552dd1d7e5d3b
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v2] rust: sync: completion: mark inline complete_all and wait_for_completion
2026-03-16 10:51 ` Gary Guo
2026-03-16 14:39 ` A.L.I.C.E
@ 2026-03-16 15:10 ` Fabricio Parra
2026-03-16 15:16 ` Gary Guo
1 sibling, 1 reply; 6+ messages in thread
From: Fabricio Parra @ 2026-03-16 15:10 UTC (permalink / raw)
To: Gary Guo, Miguel Ojeda
Cc: Boqun Feng, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Alice Ryhl, Trevor Gross, Danilo Krummrich, rust-for-linux,
linux-kernel, Fabricio Parra
When building the kernel using the llvm-22.1.0-rust-1.93.1-x86_64
toolchain provided by kernel.org with ARCH=x86_64, the following symbols
are generated:
$ nm vmlinux | grep ' _R'.*Completion | rustfilt
ffffffff81827930 T <kernel::sync::completion::Completion>::complete_all
ffffffff81827950 T <kernel::sync::completion::Completion>::wait_for_completion
These Rust methods are thin wrappers around the C completion helpers
`complete_all` and `wait_for_completion`. Mark them `#[inline]` to keep
the wrapper pattern consistent with other small Rust helper methods.
After applying this patch, the above command will produce no output.
Link: https://github.com/Rust-for-Linux/linux/issues/1145
Suggested-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Fabricio Parra <a@alice0.com>
---
v2:
- Fixed malformed email header (RFC 5322) in the From line.
rust/kernel/sync/completion.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/rust/kernel/sync/completion.rs b/rust/kernel/sync/completion.rs
index c50012a940a3..35ff049ff078 100644
--- a/rust/kernel/sync/completion.rs
+++ b/rust/kernel/sync/completion.rs
@@ -94,6 +94,7 @@ fn as_raw(&self) -> *mut bindings::completion {
///
/// This method wakes up all tasks waiting on this completion; after this operation the
/// completion is permanently done, i.e. signals all current and future waiters.
+ #[inline]
pub fn complete_all(&self) {
// SAFETY: `self.as_raw()` is a pointer to a valid `struct completion`.
unsafe { bindings::complete_all(self.as_raw()) };
@@ -105,6 +106,7 @@ pub fn complete_all(&self) {
/// timeout.
///
/// See also [`Completion::complete_all`].
+ #[inline]
pub fn wait_for_completion(&self) {
// SAFETY: `self.as_raw()` is a pointer to a valid `struct completion`.
unsafe { bindings::wait_for_completion(self.as_raw()) };
base-commit: 79e25710e7227228902d672417b552dd1d7e5d3b
--
2.53.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v2] rust: sync: completion: mark inline complete_all and wait_for_completion
2026-03-16 15:10 ` [PATCH v2] " Fabricio Parra
@ 2026-03-16 15:16 ` Gary Guo
2026-03-18 16:47 ` Boqun Feng
0 siblings, 1 reply; 6+ messages in thread
From: Gary Guo @ 2026-03-16 15:16 UTC (permalink / raw)
To: Fabricio Parra, Gary Guo, Miguel Ojeda
Cc: Boqun Feng, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Alice Ryhl, Trevor Gross, Danilo Krummrich, rust-for-linux,
linux-kernel
On Mon Mar 16, 2026 at 3:10 PM GMT, Fabricio Parra wrote:
> When building the kernel using the llvm-22.1.0-rust-1.93.1-x86_64
> toolchain provided by kernel.org with ARCH=x86_64, the following symbols
> are generated:
>
> $ nm vmlinux | grep ' _R'.*Completion | rustfilt
> ffffffff81827930 T <kernel::sync::completion::Completion>::complete_all
> ffffffff81827950 T <kernel::sync::completion::Completion>::wait_for_completion
>
> These Rust methods are thin wrappers around the C completion helpers
> `complete_all` and `wait_for_completion`. Mark them `#[inline]` to keep
> the wrapper pattern consistent with other small Rust helper methods.
>
> After applying this patch, the above command will produce no output.
>
> Link: https://github.com/Rust-for-Linux/linux/issues/1145
> Suggested-by: Alice Ryhl <aliceryhl@google.com>
> Signed-off-by: Fabricio Parra <a@alice0.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
> ---
> v2:
> - Fixed malformed email header (RFC 5322) in the From line.
>
> rust/kernel/sync/completion.rs | 2 ++
> 1 file changed, 2 insertions(+)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] rust: sync: completion: mark inline complete_all and wait_for_completion
2026-03-16 15:16 ` Gary Guo
@ 2026-03-18 16:47 ` Boqun Feng
0 siblings, 0 replies; 6+ messages in thread
From: Boqun Feng @ 2026-03-18 16:47 UTC (permalink / raw)
To: Gary Guo
Cc: Fabricio Parra, Miguel Ojeda, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
rust-for-linux, linux-kernel
On Mon, Mar 16, 2026 at 03:16:50PM +0000, Gary Guo wrote:
> On Mon Mar 16, 2026 at 3:10 PM GMT, Fabricio Parra wrote:
> > When building the kernel using the llvm-22.1.0-rust-1.93.1-x86_64
> > toolchain provided by kernel.org with ARCH=x86_64, the following symbols
> > are generated:
> >
> > $ nm vmlinux | grep ' _R'.*Completion | rustfilt
> > ffffffff81827930 T <kernel::sync::completion::Completion>::complete_all
> > ffffffff81827950 T <kernel::sync::completion::Completion>::wait_for_completion
> >
> > These Rust methods are thin wrappers around the C completion helpers
> > `complete_all` and `wait_for_completion`. Mark them `#[inline]` to keep
> > the wrapper pattern consistent with other small Rust helper methods.
> >
> > After applying this patch, the above command will produce no output.
> >
> > Link: https://github.com/Rust-for-Linux/linux/issues/1145
> > Suggested-by: Alice Ryhl <aliceryhl@google.com>
> > Signed-off-by: Fabricio Parra <a@alice0.com>
>
> Reviewed-by: Gary Guo <gary@garyguo.net>
>
Queued in rust-sync, thank you!
Regards,
Boqun
> > ---
> > v2:
> > - Fixed malformed email header (RFC 5322) in the From line.
> >
> > rust/kernel/sync/completion.rs | 2 ++
> > 1 file changed, 2 insertions(+)
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-03-18 16:47 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16 8:21 [PATCH] rust: sync: completion: mark inline complete_all and wait_for_completion Fabricio
2026-03-16 10:51 ` Gary Guo
2026-03-16 14:39 ` A.L.I.C.E
2026-03-16 15:10 ` [PATCH v2] " Fabricio Parra
2026-03-16 15:16 ` Gary Guo
2026-03-18 16:47 ` Boqun Feng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox