[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zyuy25viG51DDRk7@Boquns-Mac-mini.local>
Date: Wed, 6 Nov 2024 10:18:03 -0800
From: Boqun Feng <boqun.feng@...il.com>
To: FUJITA Tomonori <fujita.tomonori@...il.com>
Cc: anna-maria@...utronix.de, frederic@...nel.org, tglx@...utronix.de,
jstultz@...gle.com, sboyd@...nel.org, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, rust-for-linux@...r.kernel.org,
andrew@...n.ch, hkallweit1@...il.com, tmgross@...ch.edu,
ojeda@...nel.org, alex.gaynor@...il.com, gary@...yguo.net,
bjorn3_gh@...tonmail.com, benno.lossin@...ton.me,
a.hindborg@...sung.com, aliceryhl@...gle.com, arnd@...db.de
Subject: Re: [PATCH v5 6/7] rust: Add read_poll_timeout functions
On Fri, Nov 01, 2024 at 10:01:20AM +0900, FUJITA Tomonori wrote:
[...]
> @@ -44,6 +45,7 @@
> pub mod page;
> pub mod prelude;
> pub mod print;
> +pub mod processor;
> pub mod sizes;
> pub mod rbtree;
> mod static_assert;
> diff --git a/rust/kernel/processor.rs b/rust/kernel/processor.rs
> new file mode 100644
> index 000000000000..eeeff4be84fa
> --- /dev/null
> +++ b/rust/kernel/processor.rs
What else would we put into this file? `smp_processor_id()` and IPI
functionality? If so, I would probably want to rename this to cpu.rs.
Regards,
Boqun
> @@ -0,0 +1,13 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +//! Processor related primitives.
> +//!
> +//! C header: [`include/linux/processor.h`](srctree/include/linux/processor.h).
> +
> +/// Lower CPU power consumption or yield to a hyperthreaded twin processor.
> +///
> +/// It also happens to serve as a compiler barrier.
> +pub fn cpu_relax() {
> + // SAFETY: FFI call.
> + unsafe { bindings::cpu_relax() }
> +}
> --
> 2.43.0
>
>
Powered by blists - more mailing lists