All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miguel Ojeda <ojeda@kernel.org>
To: Miguel Ojeda <ojeda@kernel.org>
Cc: "Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	rust-for-linux@vger.kernel.org
Subject: [PATCH 0/2] Support `likely`, `unlikely` and `cold_path`
Date: Sun,  8 Feb 2026 23:46:57 +0100	[thread overview]
Message-ID: <20260208224659.18406-1-ojeda@kernel.org> (raw)

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

             reply	other threads:[~2026-02-08 22:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-08 22:46 Miguel Ojeda [this message]
2026-02-08 22:46 ` [PATCH 1/2] rust: prelude: use the "kernel vertical" imports style Miguel Ojeda
2026-04-04  2:49   ` 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

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=20260208224659.18406-1-ojeda@kernel.org \
    --to=ojeda@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=lossin@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /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.