Tag Archives: rust

What Memory Model Should the Rust Language Use?

UNDER CONSTRUCTION This blog post discusses a few alternative Rust-language memory models. I hope that this discussion is of value to the Rust community, but in the end, it is their language, so it is also their choice of memory … Continue reading

Posted in Uncategorized | Tagged , , | Comments Off on What Memory Model Should the Rust Language Use?

TL;DR: Memory-Model Recommendations for Rusting the Linux Kernel

These recommendations assume that the initial Linux-kernel targets for Rust developers are device drivers that do not have unusual performance and scalability requirements, meaning that wrappering of small C-language functions is tolerable. (Please note that most device drivers fit into … Continue reading

Posted in Uncategorized | Tagged , , | Comments Off on TL;DR: Memory-Model Recommendations for Rusting the Linux Kernel

Rusting the Linux Kernel: Summary and Conclusions

We have taken a quick trip through history, through a number of the differences between the Linux kernel and the C/C++ memory models, sequence locks, RCU, ownership, zombie pointers, and KCSAN. I give a big “thank you” to everyone who … Continue reading

Posted in Uncategorized | Tagged , , | Comments Off on Rusting the Linux Kernel: Summary and Conclusions

Can the Kernel Concurrency Sanitizer Own Rust Code?

Given the data-race-freedom guarantees of Rust’s non-unsafe code, one might reasonably argue that there is no point in the Kernel Concurrency Sanitizer (KCSAN) analyzing such code. However, the Linux kernel is going to need unsafe Rust code, and although there … Continue reading

Posted in Uncategorized | Tagged , , | Comments Off on Can the Kernel Concurrency Sanitizer Own Rust Code?

Will Your Rust Code Survive the Attack of the Zombie Pointers?

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 zombie-pointer problem really does have a trivial solution, at least in the context … Continue reading

Posted in Uncategorized | Tagged , , | Comments Off on Will Your Rust Code Survive the Attack of the Zombie Pointers?

How Much of the Kernel Can Rust Own?

Rust concurrency makes heavy use of ownership and borrowing. The purpose of this post is not to give an exposition of Rust’s capabilities and limitations in this area, but rather to give a series of examples of ownership in the … Continue reading

Posted in Uncategorized | Tagged , , | Comments Off on How Much of the Kernel Can Rust Own?

Can Rust Code Own RCU?

Read-copy update (RCU) vaguely resembles a reader-writer lock [1], but one in which readers do not exclude writers. This change in semantic permits RCU readers to be exceedingly fast and scalable. In fact, in the most aggressive case, rcu_read_lock() and … Continue reading

Posted in Uncategorized | Tagged , , | Comments Off on Can Rust Code Own RCU?

Can Rust Code Own Sequence Locks?

What Are Sequence Locks? Sequence locks vaguely resemble reader-writer locks except that readers cannot block writers. If a writer runs concurrently with a reader, that reader is forced to retry its critical section. If a reader successfully completes its critical … Continue reading

Posted in Uncategorized | Tagged , , | Comments Off on Can Rust Code Own Sequence Locks?

Rusting the Linux Kernel: Compiler Writers Hate Dependencies (OOTA)

Out-of-thin-air (OOTA) values are a troubling theoretical problem, but thus far do not actually occur in practice. In the words of the Bard: “It is a tale told by an idiot, full of sound and fury, signifying nothing.” But what … Continue reading

Posted in Uncategorized | Tagged , , | Comments Off on Rusting the Linux Kernel: Compiler Writers Hate Dependencies (OOTA)

Rusting the Linux Kernel: Compiler Writers Hate Dependencies (Address/Data)

An address dependency involves a load whose return value directly or indirectly determines the address of a later load or store, which results in the earlier load being ordered before the later load or store. A data dependency involves a … Continue reading

Posted in Uncategorized | Tagged , , | Comments Off on Rusting the Linux Kernel: Compiler Writers Hate Dependencies (Address/Data)