Skip to content

RFC rust: sync: Introduce Rcu*Box

Boqun Feng dri-devel linux-fsdevel linux-media linux-mm lkml rcu rust-for-linux 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest4 patches 0 repliesNew
  2. v13 patches 11 repliesSuperseded

Changes in v2 from the cover letter

* Rebased on 7.2-rc1
* As Alice pointed out [5], RcuFreeBox::with_rcu() should return a type that disallows extending the RCU read-side critical section to outlive the guard. As for now, no user needs with_rcu(), hence remove it.

* Includes a not-for-merge example based on Alice's patch.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4rust: rcu: Add RcuBox typerust/bindings/bindings_helper.h rust/kernel/sync/rcu.rs rust/kernel/sync/rcu/rcu_box.rs+284 -10 replies
2/4rust: maple_tree: Add load_rcu()rust/kernel/maple_tree.rs+52 -00 replies
3/4rust: rcu: Introduce RcuFreeBoxrust/kernel/sync/rcu.rs rust/kernel/sync/rcu/rcu_box.rs+102 -40 replies
4/4rust: poll: use kfree_rcu() for PollCondVarrust/kernel/sync/poll.rs+21 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC PATCH v2 0/4] rust: sync: Introduce Rcu*Box

v1: https://lore.kernel.org/rust-for-linux/[email protected]/

Changes since v1:

* Rebased on 7.2-rc1
* As Alice pointed out [5], RcuFreeBox::with_rcu() should return a type that disallows extending the RCU read-side critical section to outlive the guard. As for now, no user needs with_rcu(), hence remove it.

* Includes a not-for-merge example based on Alice's patch.

v1's cover letter
-----------------

(this series is based on Alice's RFC [1] and discussion around Philipp's patches [2], [3])

As an easy way to provide RCU-protected allocation, two major types are provided:

- RcuBox<T, A>, inner T will be dropped and after a grace period.
Users: binder with maple_tree and dma_fence.
- RcuFreeBox<T, A>, inner T will be cleaned up immmediately and freed after a grace period. (Name suggestion is welcome). This is an attempt to consolidate Alice's PollCondVarBox [4] into a generic implementation, InPlaceInit support is still missing, but I want to get some feedback on the trait RcuFreeSafe.

[1]: https://lore.kernel.org/rust-for-linux/[email protected]/
[2]: https://lore.kernel.org/rust-for-linux/[email protected]/
[3]: https://lore.kernel.org/rust-for-linux/[email protected]/
[4]: https://lore.kernel.org/rust-for-linux/[email protected]/
[5]: https://lore.kernel.org/rust-for-linux/[email protected]/

Signature · 1 line
2.50.1 (Apple Git-155)