Table of Contents
Fetching ...

Cache is King: Smart Page Eviction with eBPF

Tal Zussman, Ioannis Zarkadas, Jeremy Carin, Andrew Cheng, Hubertus Franke, Jonas Pfefferle, Asaf Cidon

TL;DR

Cachebpf introduces an in-kernel, eBPF-based framework to customize Linux's page cache eviction without kernel modifications, enabling per-application policies and per-cgroup isolation. It provides a policy-function interface, eviction lists, and a safe eviction-candidate mechanism, demonstrated through policies like MRU, LFU, S3-FIFO, LHD, and GET-SCAN. The evaluation across real traces and benchmarks shows significant throughput and tail-latency improvements for application-specific policies, while highlighting the absence of a universal best policy and modest overheads. This work makes advanced eviction research accessible to kernel space, offering practical impact for diverse workloads and laying groundwork for future ML-based and broader-page-cache integration policy extensions.

Abstract

The page cache is a central part of an OS. It reduces repeated accesses to storage by deciding which pages to retain in memory. As a result, the page cache has a significant impact on the performance of many applications. However, its one-size-fits-all eviction policy performs poorly in many workloads. While the systems community has experimented with a plethora of new and adaptive eviction policies in non-OS settings (e.g., key-value stores, CDNs), it is very difficult to implement such policies in the page cache, due to the complexity of modifying kernel code. To address these shortcomings, we design a novel eBPF-based framework for the Linux page cache, called $\texttt{cachebpf}$, that allows developers to customize the page cache without modifying the kernel. $\texttt{cachebpf}$ enables applications to customize the page cache policy for their specific needs, while also ensuring that different applications' policies do not interfere with each other and preserving the page cache's ability to share memory across different processes. We demonstrate the flexibility of $\texttt{cachebpf}$'s interface by using it to implement several eviction policies. Our evaluation shows that it is indeed beneficial for applications to customize the page cache to match their workloads' unique properties, and that they can achieve up to 70% higher throughput and 58% lower tail latency.

Cache is King: Smart Page Eviction with eBPF

TL;DR

Cachebpf introduces an in-kernel, eBPF-based framework to customize Linux's page cache eviction without kernel modifications, enabling per-application policies and per-cgroup isolation. It provides a policy-function interface, eviction lists, and a safe eviction-candidate mechanism, demonstrated through policies like MRU, LFU, S3-FIFO, LHD, and GET-SCAN. The evaluation across real traces and benchmarks shows significant throughput and tail-latency improvements for application-specific policies, while highlighting the absence of a universal best policy and modest overheads. This work makes advanced eviction research accessible to kernel space, offering practical impact for diverse workloads and laying groundwork for future ML-based and broader-page-cache integration policy extensions.

Abstract

The page cache is a central part of an OS. It reduces repeated accesses to storage by deciding which pages to retain in memory. As a result, the page cache has a significant impact on the performance of many applications. However, its one-size-fits-all eviction policy performs poorly in many workloads. While the systems community has experimented with a plethora of new and adaptive eviction policies in non-OS settings (e.g., key-value stores, CDNs), it is very difficult to implement such policies in the page cache, due to the complexity of modifying kernel code. To address these shortcomings, we design a novel eBPF-based framework for the Linux page cache, called , that allows developers to customize the page cache without modifying the kernel. enables applications to customize the page cache policy for their specific needs, while also ensuring that different applications' policies do not interfere with each other and preserving the page cache's ability to share memory across different processes. We demonstrate the flexibility of 's interface by using it to implement several eviction policies. Our evaluation shows that it is indeed beneficial for applications to customize the page cache to match their workloads' unique properties, and that they can achieve up to 70% higher throughput and 58% lower tail latency.

Paper Structure

This paper contains 39 sections, 2 equations, 10 figures, 4 tables.

Figures (10)

  • Figure 1: Overview of the current Linux page cache eviction policy.
  • Figure 2: Overview of cachebpf. Eviction lists hold pointers to folios.
  • Figure 3: struct_ops for cachebpf and eviction context.
  • Figure 4: Simplified LFU implementation with cachebpf.
  • Figure 5: File search workload results (MRU policy).
  • ...and 5 more figures