TL;DR
This paper introduces EMT, an extensible OS framework for Linux that allows for the seamless integration and evaluation of novel hardware memory translation architectures. By abstracting away OS-specific details, EMT significantly lowers the barrier for researchers and developers to experiment with and optimize new memory translation schemes, addressing a critical gap in current hardware-software co-design.
What Problem Does This Paper Address?
Modern computing systems are grappling with the performance bottleneck of memory translation, especially with the advent of terabyte-scale memory and memory-intensive workloads like machine learning and graph processing. Existing operating systems, particularly Linux, have memory management systems that are tightly coupled to traditional radix-tree based page table structures. This hardwiring makes it incredibly difficult and time-consuming to integrate and evaluate new, often radically different, hardware memory translation architectures (like hashing-based schemes or flattened page tables). Consequently, many promising hardware innovations remain underexplored from an OS perspective, hindering their adoption.
Methods
The core of the paper is the Extensible Memory Translation (EMT) framework. EMT provides an architecture-neutral Linux interface that decouples the OS's memory management logic from the underlying hardware translation mechanisms. Key aspects of EMT include:
- EMT API: A set of basic and customizable functions that abstract translation operations. This API is designed to be independent of specific hardware translation structures (e.g., radix trees, hash tables).
- MMU Drivers: Hardware-specific modules that implement the EMT API for a particular translation architecture. Developers can create new MMU drivers without modifying the core OS code.
- Translation Object: A unified representation of a virtual-to-physical address mapping and its associated metadata, abstracting away hardware-specific entry formats.
- Translation Database: A structure that stores translation objects for an address space, managed independently of the underlying hardware.
- Translation Service: Manages address spaces and handles context switches, ensuring the correct translation database is active.
- Customizable Functions: Allow MMU drivers to implement hardware-specific optimizations, such as efficient iteration or fine-grained locking, while providing architecture-neutral defaults.
The authors implemented EMT-Linux, a version of Linux with the EMT framework integrated. They also developed an emulator-based toolchain using QEMU to simulate new MMU hardware, enabling development and evaluation without physical hardware.
Datasets
Not discussed in the paper. The paper focuses on microbenchmarks and real-world applications for evaluation.
Key Insights and Ideas
- OS Extensibility is Crucial for Hardware Innovation: The paper strongly argues that the lack of OS support is a major barrier to adopting new memory translation hardware. EMT aims to bridge this gap.
- Decoupling is Key: EMT's success hinges on its ability to abstract away hardware-specific details, allowing the OS to interact with diverse translation architectures through a common interface.
- The "Self-Reference Paradox" in Kernel Page Tables: When implementing hashing-based translation for kernel page tables (kECPT), the authors discovered a challenge where the kernel's own code for managing kECPT might be stored within kECPT itself, leading to potential crashes if entries are moved during hash collisions. This highlights a subtle but critical OS-level challenge for new architectures.
- OS Overhead Matters: Performance metrics like IPC alone are insufficient. The paper demonstrates that OS overhead, particularly in page fault handling, can significantly impact the overall performance of new translation architectures, a factor often overlooked in hardware-centric evaluations.
- EMT Enables New Insights: By providing a platform to evaluate new architectures within a real OS context, EMT revealed unexpected OS challenges and performance implications of ECPT, such as increased page fault handling costs.
Key Results
- Negligible Overhead: EMT-Linux introduces an average normalized kernel-routine performance of 99.9% relative to vanilla Linux, with macro benchmark overhead less than 0.1%.
- ECPT Performance: On an emulated ECPT MMU, EMT-Linux showed significant speedups in page table walks (23.1% on average) and IPC (7.0% on average) compared to x86-64 radix. Total cycles were reduced by 2.3% on average.
- FPT Performance: Flattening L3+L2 tables in FPT offered limited benefits, while flattening L4+L3 and L2+L1 (with 4KB pages) showed comparable performance to ECPT in the running phase, reducing total cycles by 6.4%.
- Optimization Effectiveness: The iterator optimization in the ECPT MMU driver saved 49.0% of total kernel work and 52.5% of page fault handling work.
- Correctness: EMT-Linux passed all 1,208 relevant tests from the Linux Test Project (LTP).
Limitations and Future Work
- Current Focus: EMT currently focuses on CPU virtual-to-physical translation and does not target IOMMU translation for DMA requests. It also assumes programs use virtual addresses and doesn't directly support designs that use physical addresses.
- Native Environment: EMT currently supports the native environment; virtualization support is planned for the future.
- Hardware Simulation: The evaluation relies on emulation and simulation. While valuable, it may not perfectly capture all nuances of real hardware.
- Future Work: The authors plan to extend EMT to support virtualization (e.g., Extended Page Tables) and explore other advanced translation schemes. They also aim to make EMT and their emulator toolchain an open platform to encourage further research.
Summary updated