rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] implement `kernel::sync::Refcount` and convert users
@ 2024-10-04 15:52 Gary Guo
  2024-10-04 15:52 ` [PATCH 1/3] rust: implement `kernel::sync::Refcount` Gary Guo
                   ` (2 more replies)
  0 siblings, 3 replies; 37+ messages in thread
From: Gary Guo @ 2024-10-04 15:52 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross
  Cc: Will Deacon, Peter Zijlstra, Mark Rutland, rust-for-linux

Currently there're two refcount usage in rust/, `Arc` and `block::mq`.
`Arc` uses `refcount_t` with FFI calls directly, and `block::mq` use
Rust atomics and custom refcounting.

This series consolidate them to have a single `Refcount` which wraps
`refcount_t` and have it used by both.

With the removal of Rust `AtomicU64` this would also make the code work
for 32-bit systems. See [1] as a previous attempt to fix this issue.

Cc: Will Deacon <will@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/rust-for-linux/20240905061214.3954271-1-davidgow@google.com/ [1]

Gary Guo (3):
  rust: implement `kernel::sync::Refcount`
  rust: convert `Arc` to use `Refcount`
  rust: block: convert `block::mq` to use `Refcount`

 rust/helpers/refcount.c            |  15 ++++
 rust/kernel/block/mq/operations.rs |   7 +-
 rust/kernel/block/mq/request.rs    |  70 ++++++-------------
 rust/kernel/sync.rs                |   2 +
 rust/kernel/sync/arc.rs            |  45 ++++++------
 rust/kernel/sync/refcount.rs       | 106 +++++++++++++++++++++++++++++
 6 files changed, 168 insertions(+), 77 deletions(-)
 create mode 100644 rust/kernel/sync/refcount.rs


base-commit: c94d8cdb9ade6357824d6c2338e03d1cc726d43a
-- 
2.44.1


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

end of thread, other threads:[~2024-10-10 11:13 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-04 15:52 [PATCH 0/3] implement `kernel::sync::Refcount` and convert users Gary Guo
2024-10-04 15:52 ` [PATCH 1/3] rust: implement `kernel::sync::Refcount` Gary Guo
2024-10-04 16:34   ` Dirk Behme
2024-10-04 18:51   ` Andreas Hindborg
2024-10-04 19:08     ` Gary Guo
2024-10-04 19:22       ` Andreas Hindborg
2024-10-05  6:04       ` Dirk Behme
2024-10-05  7:40   ` Greg KH
2024-10-05 13:31     ` Gary Guo
2024-10-05 14:26       ` Gary Guo
2024-10-07 12:30         ` Alice Ryhl
2024-10-04 15:52 ` [PATCH 2/3] rust: convert `Arc` to use `Refcount` Gary Guo
2024-10-05 12:06   ` Alice Ryhl
2024-10-05 13:12     ` Gary Guo
2024-10-04 15:52 ` [PATCH 3/3] rust: block: convert `block::mq` " Gary Guo
2024-10-04 16:43   ` Dirk Behme
2024-10-04 18:05   ` Andreas Hindborg
2024-10-05 15:08     ` Gary Guo
2024-10-05 18:47       ` Andreas Hindborg
2024-10-04 18:34   ` Andreas Hindborg
2024-10-04 18:43     ` Gary Guo
2024-10-04 19:18       ` Andreas Hindborg
2024-10-05  7:47   ` Greg KH
2024-10-05  9:48     ` Andreas Hindborg
2024-10-05 10:09       ` Greg KH
2024-10-05 10:10       ` Peter Zijlstra
2024-10-05 10:57         ` Andreas Hindborg
2024-10-05 11:05         ` Miguel Ojeda
2024-10-05 11:59       ` Alice Ryhl
2024-10-05 13:23         ` Gary Guo
2024-10-05 14:56           ` Andreas Hindborg
2024-10-10  8:39             ` Andreas Hindborg
2024-10-10  9:06               ` Andreas Hindborg
2024-10-10  9:48                 ` Benno Lossin
2024-10-10 11:13                   ` Andreas Hindborg
2024-10-05 14:51         ` Andreas Hindborg
2024-10-10  8:41   ` Andreas Hindborg

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).