From: sashiko-bot@kernel.org
To: "Philipp Stanner" <phasta@kernel.org>
Cc: ojeda@kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 3/5] rust: sync: Add abstraction for rcu_barrier()
Date: Tue, 23 Jun 2026 20:54:19 +0000 [thread overview]
Message-ID: <20260623205420.5288C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260622135654.334961-5-phasta@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The `rcu_barrier()` abstraction function is missing the mandatory `#[inline]` attribute.
--
commit 9b4d6fad89b434f3d9d6204b87f3b0eed4df4bb6
Author: Philipp Stanner <phasta@kernel.org>
rust: sync: Add abstraction for rcu_barrier()
This commit adds a safe Rust abstraction for the C function rcu_barrier(),
wrapping the underlying C binding so it can be called safely from Rust.
> diff --git a/rust/kernel/sync/rcu.rs b/rust/kernel/sync/rcu.rs
> index a32bef6e490b0..9196feb62d6de 100644
> --- a/rust/kernel/sync/rcu.rs
> +++ b/rust/kernel/sync/rcu.rs
> @@ -50,3 +50,9 @@ fn drop(&mut self) {
> pub fn read_lock() -> Guard {
> Guard::new()
> }
> +
> +/// Wait for all pending [`bindings::call_rcu()`] callbacks, if there are any.
> +pub fn rcu_barrier() {
[Severity: Low]
This isn't a bug, but according to the Rust subsystem guidelines, functions
in abstractions that are small or simply forward to a C binding call should
be annotated with #[inline].
Could we add the #[inline] attribute to rcu_barrier() since it just forwards
to the C binding?
> + // SAFETY: `rcu_barrier()` is always safe to be called. It just might wait for a grace period.
> + unsafe { bindings::rcu_barrier() };
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260622135654.334961-2-phasta@kernel.org?part=3
next prev parent reply other threads:[~2026-06-23 20:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 13:56 [PATCH v4 0/5] rust / dma_buf: Add abstractions for dma_fence Philipp Stanner
2026-06-22 13:56 ` [PATCH v4 1/5] rust: types: implement ForeignOwnable for ARef<T> Philipp Stanner
2026-06-23 20:49 ` sashiko-bot
2026-06-22 13:56 ` [PATCH v4 2/5] rust: error: Add ECANCELED error code Philipp Stanner
2026-06-22 13:56 ` [PATCH v4 3/5] rust: sync: Add abstraction for rcu_barrier() Philipp Stanner
2026-06-23 20:54 ` sashiko-bot [this message]
2026-06-22 13:56 ` [PATCH v4 4/5] rust: Add dma_fence abstractions Philipp Stanner
2026-06-23 21:06 ` sashiko-bot
2026-06-22 13:56 ` [PATCH v4 5/5] MAINTAINERS: Add entry for Rust dma-buf Philipp Stanner
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=20260623205420.5288C1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=ojeda@kernel.org \
--cc=phasta@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.