[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87pl9k3c2i.fsf@t14s.mail-host-address-is-not-set>
Date: Fri, 14 Nov 2025 15:48:05 +0100
From: Andreas Hindborg <a.hindborg@...nel.org>
To: Mitchell Levy <levymitchell0@...il.com>, Miguel Ojeda
<ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, Boqun Feng
<boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, Björn
Roy Baron
<bjorn3_gh@...tonmail.com>, Alice Ryhl <aliceryhl@...gle.com>, Trevor
Gross <tmgross@...ch.edu>, Andrew Morton <akpm@...ux-foundation.org>,
Dennis Zhou <dennis@...nel.org>, Tejun Heo <tj@...nel.org>, Christoph
Lameter <cl@...ux.com>, Danilo Krummrich <dakr@...nel.org>, Benno Lossin
<lossin@...nel.org>, Yury Norov <yury.norov@...il.com>, Viresh Kumar
<viresh.kumar@...aro.org>
Cc: Tyler Hicks <code@...icks.com>, Allen Pais <apais@...ux.microsoft.com>,
linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
linux-mm@...ck.org, Mitchell Levy <levymitchell0@...il.com>
Subject: Re: [PATCH v4 4/9] rust: percpu: introduce a rust API for static
per-CPU variables
Hi Mitchell,
"Mitchell Levy" <levymitchell0@...il.com> writes:
> Per-CPU variables are an important tool for reducing lock contention,
> especially in systems with many processors. They also provide a
> convenient way to handle data that are logically associated with a
> particular CPU (e.g., the currently running task).
>
> Therefore, add a Rust API to make use of statically-allocated per-CPU
> variables. Add a RAII `CpuGuard` type for disabling CPU preemption.
> Introduce unifying abstractions that can be reused for a Rust API for
> dynamically-allocated per-CPU variables.
>
> Co-developed-by: Boqun Feng <boqun.feng@...il.com>
> Signed-off-by: Boqun Feng <boqun.feng@...il.com>
> Signed-off-by: Mitchell Levy <levymitchell0@...il.com>
I had to do the following change to make the doctests build when
applying to v6.18-rc5:
commit 47fc7e30ab0fbcc7262b846286b4bae5124d858e
Author: Andreas Hindborg <a.hindborg@...nel.org>
Date: Fri Nov 14 15:43:47 2025 +0100
fixup! LIST: [PATCH v4 4/9] rust: percpu: introduce a rust API for static per-CPU variables
diff --git a/rust/kernel/percpu/static_.rs b/rust/kernel/percpu/static_.rs
index 418fc2fa06f20..bf053e260f0c5 100644
--- a/rust/kernel/percpu/static_.rs
+++ b/rust/kernel/percpu/static_.rs
@@ -162,7 +162,7 @@ pub unsafe trait PerCpuSyncMarkerType {
/// # Example
/// ```
/// use kernel::define_per_cpu;
-/// use kernel::percpu::StaticPerCpuSymbol;
+/// use kernel::percpu::{PerCpuSyncMarkerType, StaticPerCpuSymbol};
///
/// define_per_cpu!(pub MY_PERCPU: u64 = 0);
/// ```
Best regards,
Andreas Hindborg
Powered by blists - more mailing lists