From: "Gary Guo" <gary@garyguo.net>
To: "Onur Özkan" <work@onurozkan.dev>,
rcu@vger.kernel.org, rust-for-linux@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: <ojeda@kernel.org>, <boqun@kernel.org>, <gary@garyguo.net>,
<bjorn3_gh@protonmail.com>, <lossin@kernel.org>,
<a.hindborg@kernel.org>, <aliceryhl@google.com>,
<tmgross@umich.edu>, <dakr@kernel.org>, <peterz@infradead.org>,
<fujita.tomonori@gmail.com>, <tamird@kernel.org>,
<jiangshanlai@gmail.com>, <paulmck@kernel.org>,
<josh@joshtriplett.org>, <rostedt@goodmis.org>,
<mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH v10 4/5] rust: sync: add SRCU abstraction
Date: Fri, 10 Jul 2026 14:42:01 +0100 [thread overview]
Message-ID: <DJUXNT3MAGQ0.2HNFY66YDABZ3@garyguo.net> (raw)
In-Reply-To: <20260613065348.96750-5-work@onurozkan.dev>
On Sat Jun 13, 2026 at 7:40 AM BST, Onur Özkan wrote:
> Add a Rust abstraction for sleepable RCU (SRCU), backed by C srcu_struct.
> Provide FFI helpers and a safe wrapper with a guard-based API for read-side
> critical sections.
>
> Cleanup is handled via `PinnedDrop`. It first checks for active read-side
> sections and emits a warning if any guards were leaked. In that case, it
> waits in `synchronize_srcu()` rather than risking a UAF by freeing the
> `srcu_struct` that is still reachable from the C side. It then uses
> `srcu_barrier()` to drain pending callbacks before finally calling
> `cleanup_srcu_struct()`.
>
> Signed-off-by: Onur Özkan <work@onurozkan.dev>
Reviewed-by: Gary Guo <gary@garyguo.net>
> ---
> rust/kernel/sync.rs | 2 +
> rust/kernel/sync/srcu.rs | 171 +++++++++++++++++++++++++++++++++++++++
> 2 files changed, 173 insertions(+)
> create mode 100644 rust/kernel/sync/srcu.rs
next prev parent reply other threads:[~2026-07-10 13:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-13 6:40 [PATCH v10 0/5] rust: add SRCU abstraction Onur Özkan
2026-06-13 6:40 ` [PATCH v10 1/5] srcu: make init_srcu_struct() consistently wrap __init_srcu_struct() Onur Özkan
2026-07-10 13:38 ` Gary Guo
2026-06-13 6:40 ` [PATCH v10 2/5] rust: helpers: add SRCU helpers Onur Özkan
2026-07-10 13:39 ` Gary Guo
2026-06-13 6:40 ` [PATCH v10 3/5] srcu: expose srcu_readers_active() Onur Özkan
2026-06-13 6:40 ` [PATCH v10 4/5] rust: sync: add SRCU abstraction Onur Özkan
2026-07-06 11:55 ` Alice Ryhl
2026-07-06 12:39 ` Gary Guo
2026-07-06 13:01 ` Onur Özkan
2026-07-10 13:42 ` Gary Guo [this message]
2026-06-13 6:40 ` [PATCH v10 5/5] MAINTAINERS: add Rust SRCU files to SRCU entry Onur Özkan
2026-07-02 13:53 ` [PATCH v10 0/5] rust: add SRCU abstraction Onur Özkan
2026-07-10 12:38 ` Alice Ryhl
2026-07-10 14:18 ` Boqun Feng
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=DJUXNT3MAGQ0.2HNFY66YDABZ3@garyguo.net \
--to=gary@garyguo.net \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=fujita.tomonori@gmail.com \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=ojeda@kernel.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox