rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: FUJITA Tomonori <fujita.tomonori@gmail.com>
To: boqun.feng@gmail.com, ojeda@kernel.org, peterz@infradead.org,
	will@kernel.org
Cc: acourbot@nvidia.com, a.hindborg@kernel.org, aliceryhl@google.com,
	bjorn3_gh@protonmail.com, dakr@kernel.org, gary@garyguo.net,
	lossin@kernel.org, mark.rutland@arm.com, tmgross@umich.edu,
	rust-for-linux@vger.kernel.org
Subject: [PATCH v3 0/4] rust: Add i8 and i16 atomic support
Date: Thu, 11 Dec 2025 20:38:22 +0900	[thread overview]
Message-ID: <20251211113826.1299077-1-fujita.tomonori@gmail.com> (raw)

This adds Atomic<i8> and Atomic<i16> support; including
load/store(Relaxed) and load(Acquire)/store(Release) operations.

Relaxed operations are implemented in C's READ_ONCE() and
WRITE_ONCE() macros.

load(Acquire)/store(Release) use C's smp_load_acquire() and
smp_store_release() macros. They internally use the appropriate
architecture-specific instructions.

v3:
- Move i8/i16 AtomicImp next to i32/i64 with the comments updated
- Add a comment about leaving the existing macros untouched
- Add __rust_helper for helpers
- Update commit messages about atomic_ext.c instead of atomic.c
v2: https://lore.kernel.org/rust-for-linux/20251117001035.4068507-1-fujita.tomonori@gmail.com/
- Implement relaxed operations by using C's READ_ONCE/WRITE_ONCE
- Rename smp_load_acquire() and smp_store_release() helpers
- Simplify the macro to generate atomic methods
v1: https://lore.kernel.org/rust-for-linux/20251115050305.3872412-1-fujita.tomonori@gmail.com/

FUJITA Tomonori (4):
  rust: sync: Add i8/i16 atomic_load_acquire/atomic_store_release
    helpers
  rust: helpers: Add i8/i16 relaxed atomic helpers
  rust: sync: atomic: Add i8/i16 load and store support
  rust: sync: atomic: Add store_release/load_acquire tests

 rust/helpers/atomic_ext.c            | 44 ++++++++++++++++++
 rust/helpers/helpers.c               |  1 +
 rust/kernel/sync/atomic/internal.rs  | 69 ++++++++++++++++++++++++++--
 rust/kernel/sync/atomic/predefine.rs | 24 +++++++++-
 4 files changed, 132 insertions(+), 6 deletions(-)
 create mode 100644 rust/helpers/atomic_ext.c


base-commit: d358e5254674b70f34c847715ca509e46eb81e6f
-- 
2.43.0


             reply	other threads:[~2025-12-11 11:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-11 11:38 FUJITA Tomonori [this message]
2025-12-11 11:38 ` [PATCH v3 1/4] rust: sync: Add i8/i16 atomic_load_acquire/atomic_store_release helpers FUJITA Tomonori
2025-12-11 11:38 ` [PATCH v3 2/4] rust: helpers: Add i8/i16 relaxed atomic helpers FUJITA Tomonori
2025-12-11 11:38 ` [PATCH v3 3/4] rust: sync: atomic: Add i8/i16 load and store support FUJITA Tomonori
2025-12-11 11:38 ` [PATCH v3 4/4] rust: sync: atomic: Add store_release/load_acquire tests FUJITA Tomonori
2025-12-11 16:49 ` [PATCH v3 0/4] rust: Add i8 and i16 atomic support Joel Fernandes
2025-12-11 17:37 ` Gary Guo
2025-12-11 20:05   ` Joel Fernandes
2025-12-14 21:54 ` 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=20251211113826.1299077-1-fujita.tomonori@gmail.com \
    --to=fujita.tomonori@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=lossin@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=ojeda@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    --cc=will@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).