Flexible Paging in Linux: Per-process Page Size - Dev Jain, Arm Ltd
Join us at the premier vendor-neutral open source conference, where developers and technologists come together to collaborate, share knowledge, and explore the latest innovations and advancements in open source technology. Learn more at https://events.linuxfoundation.org/
Flexible Paging in Linux: Per-process Page Size - Dev Jain, Arm Ltd
Applications often run faster on a 64K page size kernel than on 4K. This is because larger pages reduce TLB pressure and pagetable walk overhead, greatly improving memory access speed. But, sysadmins are hesitant to use a 16K/64K kernel as most applications have been historically tuned for 4K pages, and larger pages can increase memory waste due to internal fragmentation. This creates a tradeoff between performance and memory waste.
We propose a design that changes the game by separating the page size of the user and the kernel. Instead of enforcing a single system-wide page size, processes can operate under different page-size ABIs. A performance-critical app can use a 64K page-size ABI while still running on a 4K kernel. We achieve this by enabling Linux to provide memory in 64K chunks via 16 contiguous 4K pages, and by translating operations on the 4K page table into a 64K “native” page table that serves as the actual hardware page table.
At the same time, lightweight or memory-sensitive applications can continue using 4K pages to minimize memory waste. All of this happens on the same Linux kernel, without requiring separate builds of the kernel.
The Linux Foundation
The Linux Foundation is a nonprofit consortium dedicated to fostering the growth of Linux and collaborative software development. Founded in 2000, the organization sponsors the work of Linux creator Linus Torvalds and promotes, protects and advances the L...