Shared Memory, Shared Page Tables: The Promise of Linux mshare

Introduction

In Linux, processes can share memory regions for inter‑process communication or data pooling. However, each process nearly always maintains its own set of page tables—even for memory that is identical across many processes. When a large number of processes share the same physical memory, the combined size of their page tables can actually exceed the size of the shared memory itself. This overhead has spurred long‑standing interest in allowing unrelated processes to share not just the memory, but also the page tables that map it. The latest effort, known as mshare, is being driven by Anthony Yznaga. He presented the current status of this work during the memory‑management track of the 2026 Linux Storage, Filesystem, Memory Management, and BPF Summit (LSFMM+BPF).

Shared Memory, Shared Page Tables: The Promise of Linux mshare

The Overhead of Traditional Shared Memory

Per‑Process Page Tables and Their Cost

Every process in Linux has its own virtual address space, managed by a hierarchy of page tables. When memory is shared—for example via mmap with MAP_SHARED or through System V shared memory—the physical pages are the same, but each process still builds its own page table entries (PTEs) for those pages. For a shared region of, say, 1 GB, each participating process adds about 2 MB of page table overhead (assuming 4 KB pages). With hundreds or thousands of processes, the aggregate page table memory can balloon into gigabytes, dwarfing the actual shared data.

When Sharing Becomes a Burden

This situation is especially painful in workloads that rely on massive shared memory pools:

In each case, the page table overhead not only consumes precious memory but also increases TLB (translation lookaside buffer) pressure and can degrade performance.

The mshare Solution: Sharing Page Tables

How mshare Differs from Existing Approaches

Existing mechanisms like KSM merge identical physical pages across processes, but they keep per‑process page table entries. That still leaves the page table overhead largely untouched. Other techniques, such as huge pages, reduce the number of PTEs but don't eliminate duplication when multiple processes map the same huge page.

mshare tackles the problem at the root: it enables unrelated processes to share the same page table structures for a given shared memory region. Instead of each process maintaining its own copy of the page table hierarchy for that region, they all point to a single shared set of page tables. This directly eliminates the redundant page table memory and can also reduce TLB misses because the same page table entries are cached in a unified way.

Historical Attempts and Current Progress

The idea of sharing page tables is not new. Earlier proposals—such as the Vortext work or the ksm‑based shared page tables patches—explored similar concepts but never matured into the mainline kernel. Anthony Yznaga’s mshare patch set builds on those lessons and aims to provide a clean, general‑purpose mechanism. At LSFMM+BPF 2026, Yznaga described the current implementation status:

The presentation also highlighted remaining challenges—particularly synchronising page table modifications and ensuring proper reference counting.

Potential Benefits and Challenges

Performance Implications

If mshare reaches mainline, the benefits could be significant:

Security and Isolation Concerns

Sharing page tables between unrelated processes raises important security questions. If one process modifies a page table entry (e.g., to change permissions or to unmap a page), that change instantly affects all sharing processes. The kernel must enforce strict permission checks and ensure that only trusted processes can attach to a shared page‑table domain. Yznaga’s design includes capability‑based controls and namespace awareness to prevent accidental or malicious interference. Additionally, memory types like IOMMU and VMA locking need careful handling.

The 2026 LSFMM+BPF Presentation

During the memory‑management session, Yznaga walked through the current patch series (which was at version 6 at the time) and collected feedback from kernel developers. Key points raised in the discussion included:

While no final decision was made, the general sentiment was positive, with several developers expressing interest in further collaboration.

Conclusion

mshare represents a promising step toward eliminating a long‑standing source of memory waste in Linux. By allowing unrelated processes to share page tables for common memory regions, it could dramatically reduce overhead in large‑scale shared‑memory environments. Anthony Yznaga’s work has brought the concept closer to reality, and the feedback from LSFMM+BPF 2026 will help refine the implementation. If mshare is eventually merged, it will be a valuable tool for systems administrators and application developers seeking to maximise memory efficiency in multi‑process workloads.

Recommended

Discover More

Designers Ditch Adobe and Figma: Claude Design Sparks Industry ShiftMann Versus Zombies: The Unofficial TF2 Zombie Mod That Could Pass as OfficialHow to Analyze Apple’s Strategic Acquisitions Under Tim Cook: A Step-by-Step GuideThe Sweet Science of Honey: Ancient Remedy or Modern Myth?Star Wars Is My White Whale: Mortal Kombat Writer Reveals the One Franchise He Would 'Die' to Join