Rust for Linux List
 help / color / mirror / Atom feed
* [PATCH v4 0/2] rust: sync: atomic flag helpers
@ 2026-01-15  2:12 FUJITA Tomonori
  2026-01-15  2:12 ` [PATCH v4 1/2] rust: sync: atomic: Add performance-optimal-integer-backed Flag for atomic booleans FUJITA Tomonori
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: FUJITA Tomonori @ 2026-01-15  2:12 UTC (permalink / raw)
  To: boqun.feng, ojeda, peterz, will
  Cc: a.hindborg, aliceryhl, bjorn3_gh, dakr, gary, lossin,
	mark.rutland, tmgross, rust-for-linux

This series improves the Rust atomic-boolean support.

The first patch adds a Flag enum (Clear/Set) and implements AtomicType
for it, so Atomic<Flag> can be used when RMW operations (xchg/cmpxchg)
are needed and byte-sized RMWs may be inefficient.

The second patch adds AtomicFlag as a thin wrapper around Atomic<Flag>
to provide a simple bool-based load/store/xchg API.

v4:
- Make Flag backing type architecture-dependent
- Make AtomicFlag::new inline
- Add Flag::new and modify AtomicFlag::new use it
v3: https://lore.kernel.org/rust-for-linux/20260111050558.3147975-1-fujita.tomonori@gmail.com/
- Add AtomicFlag struct provding a simple bool API
v2: https://lore.kernel.org/rust-for-linux/20260108125005.2945800-1-fujita.tomonori@gmail.com/
- Update the description
- Add bidirectional From conversions between Flag and bool
- Use intra-doc links
- Fix level header for Examples
- Fix a typo
- Add a newline after the `use`s block in examples
v1: https://lore.kernel.org/rust-for-linux/20260101102718.2073674-1-fujita.tomonori@gmail.com/

FUJITA Tomonori (2):
  rust: sync: atomic: Add performance-optimal-integer-backed Flag for
    atomic booleans
  rust: sync: atomic: Add AtomicFlag bool wrapper for easier use

 rust/kernel/sync/atomic.rs | 114 +++++++++++++++++++++++++++++++++++++
 1 file changed, 114 insertions(+)


base-commit: 7bd94324bf04ca1161d94fc193adf782b0cfc0a9
-- 
2.43.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-01-20  2:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-15  2:12 [PATCH v4 0/2] rust: sync: atomic flag helpers FUJITA Tomonori
2026-01-15  2:12 ` [PATCH v4 1/2] rust: sync: atomic: Add performance-optimal-integer-backed Flag for atomic booleans FUJITA Tomonori
2026-01-15 13:22   ` Gary Guo
2026-01-19  1:22   ` Boqun Feng
2026-01-19  3:10     ` FUJITA Tomonori
2026-01-19 23:08       ` FUJITA Tomonori
2026-01-20  2:56         ` Boqun Feng
2026-01-15  2:12 ` [PATCH v4 2/2] rust: sync: atomic: Add AtomicFlag bool wrapper for easier use FUJITA Tomonori
2026-01-15 13:22   ` Gary Guo
2026-01-15  6:41 ` [PATCH v4 0/2] rust: sync: atomic flag helpers Alice Ryhl
2026-01-15  8:59   ` FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox