|
|
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 7:41 UTC (Mon) by dvdeug (guest, #10998)
Parent article: McKenney: So You Want to Rust the Linux Kernel?

It seems like a lot of hand-grenade juggling is going on here. Take "At the assembly language level on many weakly ordered architectures, a conditional branch acts as a very weak, very cheap, but very useful memory-barrier instruction. It orders any load whose return value feeds into the condition codes before all stores that execute after the branch instruction completes, whether the branch is taken or not. ARMv8 also has a conditional-move instruction (CSEL) that provides similar ordering."

Making C's "if" into a memory-barrier statement is the opposite of being explicit. It's almost certainly pessimizing some part of the code if the compiler has to treat every "if" statement as a barrier to certain optimizations. No matter what Rust does, wouldn't it better to actually tell the C compiler what you're doing there?


to post comments

McKenney: So You Want to Rust the Linux Kernel?

Posted Oct 4, 2021 9:00 UTC (Mon) by pbonzini (subscriber, #60935) [Link]

Yes, and discussions on this very topic are in progress. See https://lwn.net/Articles/860037/ for a summary as of last June.


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