public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Support `likely`, `unlikely` and `cold_path`
@ 2026-02-08 22:46 Miguel Ojeda
  2026-02-08 22:46 ` [PATCH 1/2] rust: prelude: use the "kernel vertical" imports style Miguel Ojeda
  2026-02-08 22:46 ` [PATCH 2/2] rust: std_vendor: add `{likely,unlikely,cold_path}()` Miguel Ojeda
  0 siblings, 2 replies; 8+ messages in thread
From: Miguel Ojeda @ 2026-02-08 22:46 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

Rust 1.95.0 stabilized the `cold_path` feature, which means that it is
a good time to add the support for this pervasive feature in C.

The functions should work as expected for all Rust >= 1.84.0, which
includes our future bumped Rust minimum version. For older versions,
they are a no-op.

Miguel Ojeda (2):
  rust: prelude: use the "kernel vertical" imports style
  rust: std_vendor: add `{likely,unlikely,cold_path}()`

 init/Kconfig              |   6 ++
 rust/kernel/lib.rs        |   9 +++
 rust/kernel/prelude.rs    | 119 ++++++++++++++++++++++++-------
 rust/kernel/std_vendor.rs | 144 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 252 insertions(+), 26 deletions(-)

--
2.53.0

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-02-09 19:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-08 22:46 [PATCH 0/2] Support `likely`, `unlikely` and `cold_path` Miguel Ojeda
2026-02-08 22:46 ` [PATCH 1/2] rust: prelude: use the "kernel vertical" imports style Miguel Ojeda
2026-02-08 22:46 ` [PATCH 2/2] rust: std_vendor: add `{likely,unlikely,cold_path}()` Miguel Ojeda
2026-02-09  5:22   ` Gary Guo
2026-02-09 12:07     ` Andreas Hindborg
2026-02-09 12:18       ` Miguel Ojeda
2026-02-09 19:12         ` Andreas Hindborg
2026-02-09 12:28     ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox