Abstract
Modern operating systems utilize lazy allocation, which triggers minor page faults upon the first access to memory. While these faults do not involve disk I/O, the cumulative overhead of kernel traps, page zeroing, and page table updates significantly impacts performance in memory-intensive applications. This paper presents the Minor Fault Offload Engine (MFOE), a hardware-software co-design that offloads minor page fault handling to a dedicated per-core accelerator. By pre-allocating pages in the background and enabling hardware-managed page table updates, MFOE reduces fault-handling latency by over 30x and improves application performance by up to 25%.
1. Introduction
Modern operating systems rely on lazy allocation to optimize physical memory usage. Physical memory is only assigned when an application first attempts to access a virtual address, triggering a "minor page fault." Although these faults are less severe than "major" faults requiring disk I/O, they remain computationally expensive. Handling a minor fault necessitates a CPU trap into the kernel, finding a free physical page, zeroing it for security, updating the page table, and returning to user mode. This sequence can consume thousands of cycles.
As memory footprints grow in domains like Function-as-a-Service (FaaS) and large-scale databases, these overheads aggregate into a significant bottleneck. As shown in Table 1, minor page faults can account for nearly 30% of total execution time in benchmarks like the GCC compiler.
2. Methodology: The Minor Fault Offload Engine (MFOE)
The authors propose MFOE, a two-pronged approach to mitigate these overheads by decoupling page allocation from the critical path of execution.
2.1 Software Support
A background kernel thread proactively allocates and zeroes physical pages, storing them in a per-core Pre-allocation Table. When an application requests memory (e.g., via malloc), the kernel marks the corresponding page table entries (PTEs) with a new "MFOEable" bit. This bit signals that hardware can autonomously handle future faults on these addresses.
2.2 Hardware Accelerator
The MFOE is integrated into the CPU's page walker. Upon a TLB miss on an "MFOEable" but "not present" page, the MFOE intercepts the fault. Instead of triggering a software exception and kernel trap, it retrieves a page from the pre-allocation table, updates the PTE directly, and populates the TLB. This hardware-managed flow avoids the massive overhead of context switching between user and kernel modes.
3. Evaluation and Results
The system was evaluated using the gem5 architectural simulator with a modified Linux kernel (v4.9.182). A diverse set of workloads was tested, including GCC, FaaS profilers, YCSB-memcached, PARSEC (dedup), and scientific computing benchmarks (XSBench, GAP-BC).
3.1 Performance Gains
MFOE achieved a 33× reduction in average critical-path fault handling latency and a 51× reduction in tail (95th percentile) latency. Across all applications, MFOE provided an average run-time improvement of 6.6%. The GCC compiler, which exhibits the highest fault overhead, saw the most significant gain with a 25.4% improvement in total execution time.
3.2 FaaS Sensitivity
The research highlights that Function-as-a-Service (FaaS) environments are particularly sensitive to these faults due to frequent "cold starts," where new containers must fault-in their entire memory footprint rapidly. MFOE effectively mitigates this startup latency.
4. Discussion and Limitations
The primary insight of MFOE is the decoupling of work from demand: performing page cleaning and allocation before a fault occurs. However, the current design is limited to anonymous memory (heap/stack) and does not yet support file-backed memory. Additionally, implementation requires architectural changes, such as the addition of new registers (e.g., a repurposed CR9) and bit-lock mechanisms to handle multi-threading race conditions during page table updates.
5. Conclusion
MFOE demonstrates that minor page faults, often overlooked as "minor" overheads, are a critical bottleneck for modern high-memory applications. By offloading the fault-handling logic to a lightweight hardware accelerator, systems can achieve significant performance gains with minimal architectural complexity.
Summary updated