public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Boqun Feng <boqun.feng@gmail.com>
To: FUJITA Tomonori <fujita.tomonori@gmail.com>
Cc: acourbot@nvidia.com, alex.gaynor@gmail.com, ojeda@kernel.org,
	peterz@infradead.org, will@kernel.org, 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 3/4] rust: sync: atomic: Add i8/i16 load and store support
Date: Thu, 11 Dec 2025 08:02:15 +0900	[thread overview]
Message-ID: <aTn794JgkRrwGpzm@tardis-2.local> (raw)
In-Reply-To: <20251209.081456.1519886345847572170.fujita.tomonori@gmail.com>

On Tue, Dec 09, 2025 at 08:14:56AM +0900, FUJITA Tomonori wrote:
> On Mon, 08 Dec 2025 12:08:23 +0900
> "Alexandre Courbot" <acourbot@nvidia.com> wrote:
> 
> > On Mon Nov 17, 2025 at 9:10 AM JST, FUJITA Tomonori wrote:
> >> Add atomic operation support for i8 and i16 types using volatile
> >> read/write and smp_load_acquire/smp_store_release helpers.
> >>
> >> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
> >> ---
> >>  rust/kernel/sync/atomic/internal.rs  | 48 ++++++++++++++++++++++++++++
> >>  rust/kernel/sync/atomic/predefine.rs | 14 +++++++-
> >>  2 files changed, 61 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/rust/kernel/sync/atomic/internal.rs b/rust/kernel/sync/atomic/internal.rs
> >> index 6fdd8e59f45b..4c9f4f76dbdf 100644
> >> --- a/rust/kernel/sync/atomic/internal.rs
> >> +++ b/rust/kernel/sync/atomic/internal.rs
> >> @@ -263,3 +263,51 @@ fn fetch_add[acquire, release, relaxed](a: &AtomicRepr<Self>, v: Self::Delta) ->
> >>          }
> >>      }
> >>  );
> >> +
> >> +impl private::Sealed for i8 {}
> >> +impl private::Sealed for i16 {}
> >> +
> >> +impl AtomicImpl for i8 {
> >> +    type Delta = Self;
> >> +}
> >> +
> >> +impl AtomicImpl for i16 {
> >> +    type Delta = Self;
> >> +}
> > 
> > I'd suggest putting these next to the impls for `i32` and `i64`, for clarity.
> 
> I'm fine with either. Boqun, what do you think?
> 

I think we should put them together.

> The reason I didn't put i8/i16 next to i32/i64 is that I assume that
> i8/i16 won't support all the methods supported by i32/i64. I thought
> keeping them separate would make that distinction clearer.
> 

Even if that's true, it still make sense to put the impl blocks with
i32 and i64.

Regards,
Boqun

  parent reply	other threads:[~2025-12-10 23:02 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
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 [this message]
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=aTn794JgkRrwGpzm@tardis-2.local \
    --to=boqun.feng@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.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