https://paulmck.livejournal.com/62436.html Refresh (0 sec) https://paulmck.livejournal.com/62436.html?nojs=1 [p] ? LiveJournal * Find more + Your 2020 in LJ + Communities + RSS Reader * Shop * Help * [ ] Login * [ ] * Login * Join free Join * * English (en) + English (en) + Russkii (ru) + Ukrayins'ka (uk) + Francais (fr) + Portugues (pt) + espanol (es) + Deutsch (de) + Italiano (it) + Belaruskaia (be) [userinfo_v]paulmck -- Subscribe * [ ]Readability LiveJournal Log in No account? Create an account [ ] [ ] [ ] Remember me Forgot password Log in [ ] Log in Facebook Twitter Google RAMBLER&Co ID By logging in to LiveJournal using a third-party service you accept LiveJournal's User agreement No account? Create an account [18342169] Paul E. McKenney ([userinfo_v]paulmck) wrote, 2021-09-30 17:39:00 Paul E. McKenney [userinfo_v]paulmck 2021-09-30 17:39:00 * Previous * Share * Flag * Next So You Want to Rust the Linux Kernel? UNDER CONSTRUCTION October 8, 2021: Fix s/LInux/Linux/ typo noted by Miguel Ojeda There has been much discussion of using the Rust language in the Linux kernel (for example, here, here, and here), at the Kangrejos Rust for Linux Workshop (here, here, and here) and 2021 Linux Plumbers Conference had a number of sessions on this topic, as did Maintainers Summit. At least two of these sessions mentioned the question of how Rust is to handle the Linux-kernel memory model (LKMM), and I volunteered to write this blog series on this topic. This series focuses mostly on use cases and opportunities, rather than on any non-trivial solutions. Please note that I am not in any way attempting to dictate or limit Rust's level of ambition. I am instead noting the memory-model consequences of a few potential levels of ambition, ranging from "portions of a few drivers", "a few drivers", "some core code" and up to and including "the entire kernel". Greater levels of ambition will require greater willingness to accommodate a wider variety of LKMM requirements. One could instead argue that portions or even all of the Linux kernel should instead be hammered into the Rust ownership model. On the other hand, might the rumored sudden merge of the ksmdb driver ( https://lwn.net/Articles/871098/) have been due to the implicit threat of its being rewritten in Rust? Nevertheless, in cases where Rust offers particularly desirable advantages, it is quite possible that Rust and some parts of the Linux kernel might meet somewhere in the middle. These blog posts will therefore present approaches ranging upwards from trivial workarounds. But be warned that some of the high-quality approaches require profound reworking of compiler backends that have thus far failed to spark joy in the hearts of compiler writers. In addition, Rust enjoys considerable use outside of the Linux kernel, for example, as something into which to rewrite inefficient Python scripts. (A megawatt here, a megawatt there, and pretty soon you are talking about real power consumption!) Therefore, there are probably sharp limits beyond which the core Rust developers are unwilling to go. The remaining posts in this series are as follows: 1. Rust Concurrency Philosophy: A Historical Perspective 2. Atomics and Barriers and Locks, Oh My! 3. Compiler Writers Hate Dependencies (Control) 4. Compiler Writers Hate Dependencies (Address/Data) 5. Compiler Writers Hate Dependencies (OOTA) 6. Can Rust Code Own Sequence Locks? 7. Can Rust Code Own RCU? 8. How Much of the Kernel Can Rust Own? 9. Will Your Rust Code Survive the Attack of the Zombie Pointers? 10. Can the Kernel Concurrency Sanitizer Own Rust Code? 11. Summary and Conclusions Tags: linux, lkmm, rust Subscribe Recent Posts from This Journal * * * * Rusting the Linux Kernel: Summary and Conclusions UNDER CONSTRUCTION October 7, 2021: Added atomic-operation-only option to memory-model spectrum. October 8, 2021: Fix typo noted by Miguel Ojeda... * Can the Kernel Concurrency Sanitizer Own Rust Code? UNDER CONSTRUCTION October 7, 2021: Add current state of KCSAN/ Rust integration. Clarify Rust module per Gary Guo email. Given the... * Will Your Rust Code Survive the Attack of the Zombie Pointers? UNDER CONSTRUCTION Some of the previous posts in this series have been said to be quite difficult, so I figured I owed you all an easy one. And the... * Post a new comment Error + ( ) + ( ) ramblerID + ( ) [ ] [ ] + ( ) We will log you in after post + ( ) We will log you in after post + ( ) [ ] + ( ) We will log you in after post + ( ) We will log you in after post + ( ) We will log you in after post + (*) Anonymously switch + ramblerID + LiveJournal + Facebook + Twitter + OpenId + Google + MailRu + VKontakte + Anonymously default userpic [ ] + + + + + + + + [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] Your reply will be screened Your IP address will be recorded When you submit the form an invisible reCAPTCHA check will be performed. You must follow the Privacy Policy and Google Terms of use. Post a new comment [ ] Preview comment Help * 0 comments * Post a new comment * 0 comments Follow us: + Follow us on Facebook + Follow us on Twitter Applications + iOS + Android + Huawei Choose language [English ] Current version v.517 * News * About * User Agreement * Privacy Policy * Help * Button "Share" * [top100] [] * [27737346]