RFC bus1: Capability-based IPC for Linux
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest16 patches 19 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/16 | rust/sync: add LockedBy::access_mut_unchecked()rust/ | +30 | 1 reply | |
| 2/16 | rust/sync: add Arc::drop_unless_unique()rust/ rust/ | +37 | 0 replies | |
| 3/16 | rust/alloc: add Vec::into_boxed_slice()rust/ | +67 | 4 replies | |
| 4/16 | rust/error: add EXFULL, EBADRQC, EDQUOT, ENOTRECOVERABLErust/ | +4 | 0 replies | |
| 5/16 | bus1: add module scaffoldinginclude/ init/ ipc/ +4 more | +101 | 0 replies | |
| 6/16 | bus1: add the user-space APIinclude/ | +77 | 0 replies | |
| 7/16 | bus1: add man-pageDocumentation/ | +319 | 7 replies | |
| 8/16 | bus1/util: add basic utilitiesipc/ ipc/ | +89 | 3 replies | |
| 9/16 | bus1/util: add field projectionsipc/ ipc/ | +361 | 1 reply | |
| 10/16 | bus1/util: add IntoDeref/FromDerefipc/ ipc/ | +260 | 1 reply | |
| 11/16 | bus1/util: add intrusive data-type helpersipc/ ipc/ | +398 | 0 replies | |
| 12/16 | bus1/util: add intrusive single linked listsipc/ ipc/ ipc/ | +1057 | 0 replies | |
| 13/16 | bus1/util: add intrusive rb-treeipc/ ipc/ | +1325 | 1 reply | |
| 14/16 | bus1/acct: add resouce accountingipc/ ipc/ ipc/ | +1859 | 0 replies | |
| 15/16 | bus1: introduce peers, handles, and nodesipc/ ipc/ ipc/ | +1629 | 0 replies | |
| 16/16 | bus1: implement the uapiipc/ ipc/ ipc/ +1 more | +1384 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC 00/16] bus1: Capability-based IPC for Linux
Hi
A decade is gone, the ideas stayed the same. After roughly 10 years we finally got around to write a new version of bus1, a capability-based IPC system for linux. The core idea is still the same as 10 years ago and you can find a good summary by Neil Brown on LWN [1]. In the meantime, we have successfully introduced many of the concepts of bus1 to Linux distributions (mostly as part of dbus-broker [2]) and are convinced more than ever that we should move forward with bus1. But for this initial submission I want to put focus on the Rust integration.
(Patch #7 contains a man-page with a full introduction of all concepts
of bus1. I will refrain from copying it to this cover-letter.)
The biggest change is that we stripped everything down to the basics and reimplemented the module in Rust. It is a delight not having to worry about refcount ownership and object lifetimes, but at the cost of a C<->Rust bridge that brings some challenges. For now, we settled on boxing everything that is exposed to C, and calling bindgen manually, but we would love to improve on several aspects of that in the future.
The bus1 UAPI has been stripped of any convenience helper, fast-path, or more complex API extension (e.g., promise handles, oneshot handles, unmanaged IDs, fd-passing, file-system handles,
streaming / flow-control, etc.). This does not mean that we do not want them back, but they were not necessary and can be replaced with round trips or other workarounds. Now we are left with the core of bus1, and we believe it is much easier to understand and follow.
I am only sending this to Rust4Linux now, because I want to get feedback on the Rust integration first. You are very much welcome to comment on other parts, but those might be changing heavily depending on the feedback on the Rust utilities. I will be sending the follow ups to LKML proper and then shift focus to the UAPI and bus management.
The series can be split into the following parts:
#1 - 4: Small extension to ./rust/kernel/, which we make use of later
on. These are small in size and should be easy to discuss independently.
#5 - 7: Add basic module scaffolding, UAPI definitions, and a man-page
explaining the user-space API and intended behavior.
#8 -13: Rust utilities that will be used by the bus1 module, but are not
necessarily specific to bus1. A lot of this is about intrusive data structures.
#14-16: Implement resource accounting and the bus1 core in Rust,
exposing a C API. Implement a character-device based UAPI in C.
I will gladly split the series in the future, if desired. But given that r4l generally does not merge unused code, I can carry the utilities just fine.
If you prefer browsing this online, you can find the series on codeberg [3] and github [4].
You can also find me on the r4l zulip (@dvdhrm).
Let me know what you think!
Thanks
David
[1] https://lwn.net/Articles/697191/
[2] https://github.com/bus1/dbus-broker
[3] https://codeberg.org/bus1/linux/src/branch/pr/20260331
[4] https://github.com/bus1/linux/tree/pr/20260331
David Rheinsberg (16):
rust/sync: add LockedBy::access_mut_unchecked() rust/sync: add Arc::drop_unless_unique() rust/alloc: add Vec::into_boxed_slice() rust/error: add EXFULL, EBADRQC, EDQUOT, ENOTRECOVERABLE
bus1: add module scaffolding
bus1: add the user-space API
bus1: add man-page
bus1/util: add basic utilities
bus1/util: add field projections
bus1/util: add IntoDeref/FromDeref
bus1/util: add intrusive data-type helpers bus1/util: add intrusive single linked lists bus1/util: add intrusive rb-tree
bus1/acct: add resouce accounting
bus1: introduce peers, handles, and nodes
bus1: implement the uapi
Documentation/bus1/bus1.7.rst | 319 ++++++ include/uapi/linux/bus1.h | 82 ++ init/Kconfig | 12 + ipc/Makefile | 2 +- ipc/bus1/Makefile | 29 + ipc/bus1/acct.rs | 1792 +++++++++++++++++++++++++++++++++ ipc/bus1/bus.rs | 1510 +++++++++++++++++++++++++++ ipc/bus1/cdev.c | 1326 ++++++++++++++++++++++++ ipc/bus1/cdev.h | 35 + ipc/bus1/lib.h | 202 ++++ ipc/bus1/lib.rs | 22 + ipc/bus1/main.c | 41 + ipc/bus1/util/convert.rs | 259 +++++ ipc/bus1/util/field.rs | 359 +++++++ ipc/bus1/util/intrusive.rs | 397 ++++++++ ipc/bus1/util/lll.rs | 378 +++++++ ipc/bus1/util/mod.rs | 94 ++ ipc/bus1/util/rb.rs | 1324 ++++++++++++++++++++++++ ipc/bus1/util/slist.rs | 677 +++++++++++++ rust/kernel/alloc/kvec.rs | 67 ++ rust/kernel/error.rs | 4 + rust/kernel/sync/arc.rs | 21 + rust/kernel/sync/locked_by.rs | 30 + rust/kernel/sync/refcount.rs | 16 + 24 files changed, 8997 insertions(+), 1 deletion(-) create mode 100644 Documentation/bus1/bus1.7.rst create mode 100644 include/uapi/linux/bus1.h create mode 100644 ipc/bus1/Makefile create mode 100644 ipc/bus1/acct.rs create mode 100644 ipc/bus1/bus.rs create mode 100644 ipc/bus1/cdev.c create mode 100644 ipc/bus1/cdev.h create mode 100644 ipc/bus1/lib.h create mode 100644 ipc/bus1/lib.rs create mode 100644 ipc/bus1/main.c create mode 100644 ipc/bus1/util/convert.rs create mode 100644 ipc/bus1/util/field.rs create mode 100644 ipc/bus1/util/intrusive.rs create mode 100644 ipc/bus1/util/lll.rs create mode 100644 ipc/bus1/util/mod.rs create mode 100644 ipc/bus1/util/rb.rs create mode 100644 ipc/bus1/util/slist.rs
Signature · 1 line
2.53.0