User-space guided memory management with eBPF
Loading...
Date
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
DOI
Abstract
With the ever growing memory needs of modern applications, the memory management subsystem of Operating Systems (OSes) faces increasing pressure. The focus has shifted to the address translation (AT) overhead, a major contributor to memory access latency, and inherent to the decade-old, yet essential, virtual memory abstraction. Thus, CPU vendors provide increasingly complex hardware caches, Translation Lookaside Buffers (TLBs), aiming to speed up this operation. In order to enhance TLB’s efficiency, OS and HW cooperatively implement and support huge pages. Huge pages are virtually and physically contiguous memory areas, larger than 4KiB, that can be translated using a single TLB entry. Modern, widely adopted OSes seem to not quite achieve the expected performance benefits of huge pages, partially due to cost-unaware, opportunistic, greedy allocation policies that lead them to pitfalls. On the other hand, architectures such as ARMv8-A and RISC-V introduce new huge page sizes of 64KiB and 32MiB, further complicating huge page allocation policies. In this Diploma Thesis, we introduce an existing, revolutionary technology, named eBPF, and demonstrate how it can be used to implement custom policies in the Linux memory subsystem. Inspired by CBMM, we develop an eBPF-based system that guides the kernel’s decision on which huge page size, if any, to allocate. Our approach determines the most beneficial huge page size based on user-defined benefits and empirically calculated, fixed system costs associated with promoting memory regions to different huge page sizes.
