* [PATCH v2 0/2] rust: add AtomicFlag::get_mut
@ 2026-01-26 8:10 FUJITA Tomonori
2026-01-26 8:10 ` [PATCH v2 2/2] rust: list: Use AtomicFlag in AtomicTracker FUJITA Tomonori
2026-01-26 11:41 ` [PATCH v2 0/2] rust: add AtomicFlag::get_mut Gary Guo
0 siblings, 2 replies; 7+ messages in thread
From: FUJITA Tomonori @ 2026-01-26 8:10 UTC (permalink / raw)
To: boqun.feng, ojeda, peterz, will, gary, aliceryhl
Cc: a.hindborg, bjorn3_gh, dakr, lossin, mark.rutland, tmgross,
rust-for-linux
This series adds AtomicFlag::get_mut to expose a bool API under exclusive
access, and switches the list atomic tracker to use AtomicFlag.
v2:
- Add AtomicFlag::get_mut()
- Make AtomicTracker use get_mut()
v1: https://lore.kernel.org/rust-for-linux/20260119231757.3460885-1-fujita.tomonori@gmail.com/
FUJITA Tomonori (2):
rust: sync: atomic: Add AtomicFlag::get_mut
rust: list: Use AtomicFlag in AtomicTracker
rust/kernel/list/arc.rs | 8 ++++----
rust/kernel/sync/atomic.rs | 20 ++++++++++++++++++++
rust/kernel/sync/atomic/predefine.rs | 17 +++++++++++++++++
3 files changed, 41 insertions(+), 4 deletions(-)
base-commit: ed45fc4e7712dabca517bee9f73b91e7da0030a6
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 2/2] rust: list: Use AtomicFlag in AtomicTracker
2026-01-26 8:10 [PATCH v2 0/2] rust: add AtomicFlag::get_mut FUJITA Tomonori
@ 2026-01-26 8:10 ` FUJITA Tomonori
2026-01-26 11:41 ` [PATCH v2 0/2] rust: add AtomicFlag::get_mut Gary Guo
1 sibling, 0 replies; 7+ messages in thread
From: FUJITA Tomonori @ 2026-01-26 8:10 UTC (permalink / raw)
To: boqun.feng, ojeda, peterz, will, gary, aliceryhl
Cc: a.hindborg, bjorn3_gh, dakr, lossin, mark.rutland, tmgross,
rust-for-linux
Make AtomicTracker use AtomicFlag instead of Atomic<bool> to avoid
slow byte-sized RMWs on architectures that don't support them.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
---
rust/kernel/list/arc.rs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/rust/kernel/list/arc.rs b/rust/kernel/list/arc.rs
index 2282f33913ee..5e84f500a3fe 100644
--- a/rust/kernel/list/arc.rs
+++ b/rust/kernel/list/arc.rs
@@ -6,7 +6,7 @@
use crate::alloc::{AllocError, Flags};
use crate::prelude::*;
-use crate::sync::atomic::{ordering, Atomic};
+use crate::sync::atomic::{ordering, AtomicFlag};
use crate::sync::{Arc, ArcBorrow, UniqueArc};
use core::marker::PhantomPinned;
use core::ops::Deref;
@@ -469,7 +469,7 @@ impl<T, U, const ID: u64> core::ops::DispatchFromDyn<ListArc<U, ID>> for ListArc
/// If the boolean is `false`, then there is no [`ListArc`] for this value.
#[repr(transparent)]
pub struct AtomicTracker<const ID: u64 = 0> {
- inner: Atomic<bool>,
+ inner: AtomicFlag,
// This value needs to be pinned to justify the INVARIANT: comment in `AtomicTracker::new`.
_pin: PhantomPinned,
}
@@ -480,12 +480,12 @@ pub fn new() -> impl PinInit<Self> {
// INVARIANT: Pin-init initializers can't be used on an existing `Arc`, so this value will
// not be constructed in an `Arc` that already has a `ListArc`.
Self {
- inner: Atomic::new(false),
+ inner: AtomicFlag::new(false),
_pin: PhantomPinned,
}
}
- fn project_inner(self: Pin<&mut Self>) -> &mut Atomic<bool> {
+ fn project_inner(self: Pin<&mut Self>) -> &mut AtomicFlag {
// SAFETY: The `inner` field is not structurally pinned, so we may obtain a mutable
// reference to it even if we only have a pinned reference to `self`.
unsafe { &mut Pin::into_inner_unchecked(self).inner }
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/2] rust: add AtomicFlag::get_mut
2026-01-26 8:10 [PATCH v2 0/2] rust: add AtomicFlag::get_mut FUJITA Tomonori
2026-01-26 8:10 ` [PATCH v2 2/2] rust: list: Use AtomicFlag in AtomicTracker FUJITA Tomonori
@ 2026-01-26 11:41 ` Gary Guo
2026-01-26 14:13 ` FUJITA Tomonori
1 sibling, 1 reply; 7+ messages in thread
From: Gary Guo @ 2026-01-26 11:41 UTC (permalink / raw)
To: FUJITA Tomonori, boqun.feng, ojeda, peterz, will, gary, aliceryhl
Cc: a.hindborg, bjorn3_gh, dakr, lossin, mark.rutland, tmgross,
rust-for-linux
On Mon Jan 26, 2026 at 8:10 AM GMT, FUJITA Tomonori wrote:
> This series adds AtomicFlag::get_mut to expose a bool API under exclusive
> access, and switches the list atomic tracker to use AtomicFlag.
>
> v2:
> - Add AtomicFlag::get_mut()
> - Make AtomicTracker use get_mut()
> v1: https://lore.kernel.org/rust-for-linux/20260119231757.3460885-1-fujita.tomonori@gmail.com/
>
> FUJITA Tomonori (2):
> rust: sync: atomic: Add AtomicFlag::get_mut
> rust: list: Use AtomicFlag in AtomicTracker
Hi Fujita,
I've not had the first patch in my inbox. It appears not to land in
lore.kernel.org either.
Best,
Gary
>
> rust/kernel/list/arc.rs | 8 ++++----
> rust/kernel/sync/atomic.rs | 20 ++++++++++++++++++++
> rust/kernel/sync/atomic/predefine.rs | 17 +++++++++++++++++
> 3 files changed, 41 insertions(+), 4 deletions(-)
>
>
> base-commit: ed45fc4e7712dabca517bee9f73b91e7da0030a6
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/2] rust: add AtomicFlag::get_mut
2026-01-26 11:41 ` [PATCH v2 0/2] rust: add AtomicFlag::get_mut Gary Guo
@ 2026-01-26 14:13 ` FUJITA Tomonori
2026-01-26 14:35 ` Gary Guo
0 siblings, 1 reply; 7+ messages in thread
From: FUJITA Tomonori @ 2026-01-26 14:13 UTC (permalink / raw)
To: gary
Cc: fujita.tomonori, boqun.feng, ojeda, peterz, will, aliceryhl,
a.hindborg, bjorn3_gh, dakr, lossin, mark.rutland, tmgross,
rust-for-linux
On Mon, 26 Jan 2026 11:41:54 +0000
"Gary Guo" <gary@garyguo.net> wrote:
> On Mon Jan 26, 2026 at 8:10 AM GMT, FUJITA Tomonori wrote:
>> This series adds AtomicFlag::get_mut to expose a bool API under exclusive
>> access, and switches the list atomic tracker to use AtomicFlag.
>>
>> v2:
>> - Add AtomicFlag::get_mut()
>> - Make AtomicTracker use get_mut()
>> v1: https://lore.kernel.org/rust-for-linux/20260119231757.3460885-1-fujita.tomonori@gmail.com/
>>
>> FUJITA Tomonori (2):
>> rust: sync: atomic: Add AtomicFlag::get_mut
>> rust: list: Use AtomicFlag in AtomicTracker
>
> Hi Fujita,
>
> I've not had the first patch in my inbox. It appears not to land in
> lore.kernel.org either.
Thanks. Recently, sending from my Gmail address to vger.kernel.org
hasn't been working as expected (e.g., long delays). If it still
hasn't reached lore.kernel.org by tomorrow, I'll try sending it from a
different address.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/2] rust: add AtomicFlag::get_mut
2026-01-26 14:13 ` FUJITA Tomonori
@ 2026-01-26 14:35 ` Gary Guo
2026-01-26 14:52 ` Miguel Ojeda
0 siblings, 1 reply; 7+ messages in thread
From: Gary Guo @ 2026-01-26 14:35 UTC (permalink / raw)
To: FUJITA Tomonori, gary
Cc: fujita.tomonori, boqun.feng, ojeda, peterz, will, aliceryhl,
a.hindborg, bjorn3_gh, dakr, lossin, mark.rutland, tmgross,
rust-for-linux
On Mon Jan 26, 2026 at 2:13 PM GMT, FUJITA Tomonori wrote:
> On Mon, 26 Jan 2026 11:41:54 +0000
> "Gary Guo" <gary@garyguo.net> wrote:
>
>> On Mon Jan 26, 2026 at 8:10 AM GMT, FUJITA Tomonori wrote:
>>> This series adds AtomicFlag::get_mut to expose a bool API under exclusive
>>> access, and switches the list atomic tracker to use AtomicFlag.
>>>
>>> v2:
>>> - Add AtomicFlag::get_mut()
>>> - Make AtomicTracker use get_mut()
>>> v1: https://lore.kernel.org/rust-for-linux/20260119231757.3460885-1-fujita.tomonori@gmail.com/
>>>
>>> FUJITA Tomonori (2):
>>> rust: sync: atomic: Add AtomicFlag::get_mut
>>> rust: list: Use AtomicFlag in AtomicTracker
>>
>> Hi Fujita,
>>
>> I've not had the first patch in my inbox. It appears not to land in
>> lore.kernel.org either.
>
> Thanks. Recently, sending from my Gmail address to vger.kernel.org
> hasn't been working as expected (e.g., long delays). If it still
> hasn't reached lore.kernel.org by tomorrow, I'll try sending it from a
> different address.
Hmm, Igor reported something similar too. What's strange is I am addressed
directly but also haven't received the email (my email is hosted by Microsoft
Exchange Online), in addition to vger.kernel.org.
Could be an issue on the Gmail SMTP side?
Best,
Gary
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/2] rust: add AtomicFlag::get_mut
2026-01-26 14:35 ` Gary Guo
@ 2026-01-26 14:52 ` Miguel Ojeda
0 siblings, 0 replies; 7+ messages in thread
From: Miguel Ojeda @ 2026-01-26 14:52 UTC (permalink / raw)
To: Gary Guo
Cc: FUJITA Tomonori, fujita.tomonori, boqun.feng, ojeda, peterz, will,
aliceryhl, a.hindborg, bjorn3_gh, dakr, lossin, mark.rutland,
tmgross, rust-for-linux
On Mon, Jan 26, 2026 at 3:36 PM Gary Guo <gary@garyguo.net> wrote:
>
> Hmm, Igor reported something similar too. What's strange is I am addressed
> directly but also haven't received the email (my email is hosted by Microsoft
> Exchange Online), in addition to vger.kernel.org.
>
> Could be an issue on the Gmail SMTP side?
Yeah, I didn't get the patch either...
There has been recent trouble with this indeed -- just in case, I sent
an email to the admins with you (Igor, Tomo, Gary) in Cc to see if
they may be able to suggest something on top of getting a kernel.org
account, submitting with the `b4` web endpoint, reducing subscriptions
with lei/korgalore, etc.
Cheers,
Miguel
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 0/2] rust: add AtomicFlag::get_mut
@ 2026-01-27 12:52 FUJITA Tomonori
0 siblings, 0 replies; 7+ messages in thread
From: FUJITA Tomonori @ 2026-01-27 12:52 UTC (permalink / raw)
To: boqun.feng, ojeda, peterz, will
Cc: a.hindborg, aliceryhl, bjorn3_gh, dakr, gary, lossin,
mark.rutland, tmgross, rust-for-linux, FUJITA Tomonori
From: FUJITA Tomonori <fujita.tomonori@gmail.com>
This series adds AtomicFlag::get_mut to expose a bool API under exclusive
access, and switches the list atomic tracker to use AtomicFlag.
Note that I sent this patchset yesterday, but it didn't seem to be
delivered properly, so I'm resending it via a different mail
server. Hopefully it goes through this time.
v2:
- Add AtomicFlag::get_mut()
- Make AtomicTracker use get_mut()
v1: https://lore.kernel.org/rust-for-linux/20260119231757.3460885-1-fujita.tomonori@gmail.com/
FUJITA Tomonori (2):
rust: sync: atomic: Add AtomicFlag::get_mut
rust: list: Use AtomicFlag in AtomicTracker
rust/kernel/list/arc.rs | 8 ++++----
rust/kernel/sync/atomic.rs | 20 ++++++++++++++++++++
rust/kernel/sync/atomic/predefine.rs | 17 +++++++++++++++++
3 files changed, 41 insertions(+), 4 deletions(-)
base-commit: ed45fc4e7712dabca517bee9f73b91e7da0030a6
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-01-27 12:53 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-26 8:10 [PATCH v2 0/2] rust: add AtomicFlag::get_mut FUJITA Tomonori
2026-01-26 8:10 ` [PATCH v2 2/2] rust: list: Use AtomicFlag in AtomicTracker FUJITA Tomonori
2026-01-26 11:41 ` [PATCH v2 0/2] rust: add AtomicFlag::get_mut Gary Guo
2026-01-26 14:13 ` FUJITA Tomonori
2026-01-26 14:35 ` Gary Guo
2026-01-26 14:52 ` Miguel Ojeda
-- strict thread matches above, loose matches on Subject: below --
2026-01-27 12:52 FUJITA Tomonori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox