|
|
Log in / Subscribe / Register

McKenney: So You Want to Rust the Linux Kernel?

McKenney: So You Want to Rust the Linux Kernel?

Posted Oct 4, 2021 6:47 UTC (Mon) by scientes (guest, #83068)
Parent article: McKenney: So You Want to Rust the Linux Kernel?

Maybe instead of a memory model, they should have actual IPC, like channels in Go (which rust has)? That way the APIs can be manageable and possible to secure (and drivers could even run in user-space, but that is something entirely differn't).


to post comments

McKenney: So You Want to Rust the Linux Kernel?

Posted Oct 4, 2021 7:51 UTC (Mon) by LtWorf (subscriber, #124958) [Link] (6 responses)

Isn't that what makes microkernels slow?

McKenney: So You Want to Rust the Linux Kernel?

Posted Oct 4, 2021 9:10 UTC (Mon) by ehiggs (guest, #90713) [Link] (1 responses)

If I understand correctly the alleged slowness in microkernels comes from interprocess communication. However, I think the memory model and what scientes is referring to is std::sync::mpsc[1] or crossbeam::channel[2] which are in-process channel primitives to synchronize memory.

That said, I think the functionality of these primitives depends on having a stable memory model to build on, so I'm not sure hand waving it away saying 'message passing' works here.

[1] https://doc.rust-lang.org/std/sync/mpsc/
[2] https://docs.rs/crossbeam/0.7.3/crossbeam/channel/index.html

McKenney: So You Want to Rust the Linux Kernel?

Posted Oct 4, 2021 11:40 UTC (Mon) by ehiggs (guest, #90713) [Link]

Oh jeeze, I reread scientes post and they explicitly say IPC. How do I delete pre-coffee posts?

McKenney: So You Want to Rust the Linux Kernel?

Posted Oct 7, 2021 6:50 UTC (Thu) by ncm (guest, #165) [Link] (3 responses)

Some have said that what made microkernels slow was moral depravity. I don't know any way to prove them wrong.

But, is MacOSix slow?

McKenney: So You Want to Rust the Linux Kernel?

Posted Oct 7, 2021 9:43 UTC (Thu) by LtWorf (subscriber, #124958) [Link] (2 responses)

AFAIK it's not a microkernel, so how it performs doesn't really matter.

McKenney: So You Want to Rust the Linux Kernel?

Posted Oct 9, 2021 4:43 UTC (Sat) by ncm (guest, #165) [Link] (1 responses)

Last I heard, MacOSix was made out of a Mach microkernel running a FreeBSD-based personality as a process under the Mach microkernel.

McKenney: So You Want to Rust the Linux Kernel?

Posted Oct 9, 2021 6:37 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link]

It started as a microkernel, but ended up pretty much like NT with lots of stuff inside the kernel (filesystems, graphics, network, etc.)

McKenney: So You Want to Rust the Linux Kernel?

Posted Oct 4, 2021 9:37 UTC (Mon) by ibukanov (subscriber, #3942) [Link] (2 responses)

The channels in Go or communicating serial processes (CSP) as they were called in the original paper by Tony Hoare are problematic for performance. Ada initially relied exclusively on them, but quickly gained mutexes when it was realised in eighties that the hope that the compiler could optimise CSP patterns was way too optimistic. Almost 40 years later situation has not changed much. Even in Go if one wants to max the performance one better use mutexes or other low-level synchronisation methods. So channels are just not suitable for kernel.

And even when performance is not critical channels at least as implemented in Go have numerous problems. Proper cancelation is hard. Priority message delivery is not supported. From anecdotal experience even in Go using single untyped message queue per goroutine modelling what Erlang leads to more maintainable code than using multiple typed channels and select.

McKenney: So You Want to Rust the Linux Kernel?

Posted Oct 5, 2021 15:16 UTC (Tue) by sytoka (guest, #38525) [Link] (1 responses)

And concerning Erlang, it is also a message-based communication model and the Erlang language has been used by Ericson routers for a long time?

McKenney: So You Want to Rust the Linux Kernel?

Posted Oct 5, 2021 19:52 UTC (Tue) by ibukanov (subscriber, #3942) [Link]

Message passing as implement in Erlang is very different from Go CSP. Each Erlang thread has single message queue associated with it. There is no notion of multiple channel or select statements. Erlang supports message priorities. This architecture is similar to message passing API in various OS and runtimes. They are known to work. CSP on other hand has been known to be problematic for ages.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds