From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "FUJITA Tomonori" <fujita.tomonori@gmail.com>,
<alex.gaynor@gmail.com>, <boqun.feng@gmail.com>,
<ojeda@kernel.org>, <peterz@infradead.org>, <will@kernel.org>
Cc: <a.hindborg@kernel.org>, <aliceryhl@google.com>,
<bjorn3_gh@protonmail.com>, <dakr@kernel.org>, <gary@garyguo.net>,
<lossin@kernel.org>, <mark.rutland@arm.com>,
<rust-for-linux@vger.kernel.org>, <tmgross@umich.edu>
Subject: Re: [PATCH v2 1/4] rust: sync: Add i8/i16 atomic_load_acquire/atomic_store_release helpers
Date: Mon, 08 Dec 2025 12:01:12 +0900 [thread overview]
Message-ID: <DESI0L685D0M.1NP1X7KGIDJEW@nvidia.com> (raw)
In-Reply-To: <20251117001035.4068507-2-fujita.tomonori@gmail.com>
On Mon Nov 17, 2025 at 9:10 AM JST, FUJITA Tomonori wrote:
> Add helper functions to expose smp_load_acquire() and
> smp_store_release() for i8 and i16 types.
>
> The smp_load_acquire() and smp_store_release() macros require type
> information (sizeof) to generate appropriate architecture-specific
> memory ordering instructions. Therefore, separate helper functions are
> needed for each type size.
>
> These helpers will be used by the upcoming Atomic<i8> and Atomic<i16>
> implementation to provide proper Acquire/Release semantics across all
> architectures.
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
> ---
> rust/helpers/atomic_ext.c | 23 +++++++++++++++++++++++
> rust/helpers/helpers.c | 1 +
> 2 files changed, 24 insertions(+)
> create mode 100644 rust/helpers/atomic_ext.c
Why not add these to `rust/helpers/atomic.c`?
>
> diff --git a/rust/helpers/atomic_ext.c b/rust/helpers/atomic_ext.c
> new file mode 100644
> index 000000000000..d05f6f7ba10c
> --- /dev/null
> +++ b/rust/helpers/atomic_ext.c
> @@ -0,0 +1,23 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +#include <asm/barrier.h>
> +
> +s8 rust_helper_atomic_i8_load_acquire(s8 *ptr)
I guess you will want to prefix these with `__rust_helper` in the next
revision.
next prev parent reply other threads:[~2025-12-08 3:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-17 0:10 [PATCH v2 0/4] rust: Add i8 and i16 atomic support FUJITA Tomonori
2025-11-17 0:10 ` [PATCH v2 1/4] rust: sync: Add i8/i16 atomic_load_acquire/atomic_store_release helpers FUJITA Tomonori
2025-12-08 3:01 ` Alexandre Courbot [this message]
2025-12-08 21:56 ` FUJITA Tomonori
2025-11-17 0:10 ` [PATCH v2 2/4] rust: helpers: Add i8/i16 relaxed atomic helpers FUJITA Tomonori
2025-11-17 0:10 ` [PATCH v2 3/4] rust: sync: atomic: Add i8/i16 load and store support FUJITA Tomonori
2025-12-08 3:08 ` Alexandre Courbot
2025-12-08 23:14 ` FUJITA Tomonori
2025-12-09 0:27 ` Alexandre Courbot
2025-12-09 23:31 ` FUJITA Tomonori
2025-12-10 23:16 ` Boqun Feng
2025-12-11 5:17 ` FUJITA Tomonori
2025-12-10 23:02 ` Boqun Feng
2025-12-11 4:46 ` FUJITA Tomonori
2025-11-17 0:10 ` [PATCH v2 4/4] rust: sync: atomic: Add store_release/load_acquire tests FUJITA Tomonori
2025-12-03 3:41 ` [PATCH v2 0/4] rust: Add i8 and i16 atomic support FUJITA Tomonori
2025-12-04 3:40 ` Boqun Feng
2025-12-04 13:12 ` FUJITA Tomonori
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=DESI0L685D0M.1NP1X7KGIDJEW@nvidia.com \
--to=acourbot@nvidia.com \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=fujita.tomonori@gmail.com \
--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