LLZig: Highly-Parallel Page Frame Allocation in Zig

Zig is an emerging and ambitious systems programming language that focuses on performance and robustness. It strives to be simple by avoiding hidden control flows and memory allocations and provides extensive error handling and compile-time meta-programming capabilities. Additionally, it can directly interface and statically link to existing C code. These properties might make this the perfect language to integrate into operating systems and implement low-level modules, like memory allocators.

In this thesis, we want to evaluate how well Zig can be leveraged to create safe abstractions for parallel algorithms. This is done by reimplementing an existing parallel page-allocator design, LLFree, in Zig. The goal is to find out which language features (first-class bitfields, error handling, comptime, atomics, ...) are especially helpful and if this language provides new design patterns suitable for parallel data structures. Also, the complexity and performance of this new Zig-implementation should be compared to the existing C and Rust implementations. Finally, Zig's C interoperability should be evaluated by integrating the new allocator implementation into the Linux kernel codebase.

Topics: Linux, Zig, Allocator

image


USENIX Conference A Distinguished Artifact Award
LLFree: Scalable and Optionally-Persistent Page-Frame Allocation
Lars Wrenger, Florian Rommel, Alexander Halbuer, Christian Dietrich, Daniel Lohmann2023 USENIX Annual Technical Conference (USENIX '23)USENIX Association2023Distinguished Artifact Award.
PDF Details Slides [BibTex]