5–7 Oct 2026
Europe/Prague timezone

Better Anon (Swap) Readahead

Not scheduled
20m
Kernel Memory Management MC Kernel Memory Management MC

Speaker

Kairui Song (Tencent)

Description

When handling swap page faults, the kernel often don't reads just a single page. For legacy HDDs, an entire cluster is read in. For SSDs, we check the VMA and page tables to see if nearby pages are likely to be needed soon, using a basic statistic-driven heuristic. For compressed RAM (like zram, and potentially soon zswap), traditional readahead is skipped entirely. Meanwhile, enabling (m)THP swap-in currently acts as kind of a speculative fetching.

The current implementation is not really ideal. For example, why can't we extend (m)THP support to SSDs by merging readahead detection with (m)THP lookaround? Why can't we enable a lightweight readahead for compressed RAM as well? We also need a smarter heuristic, where workingset shadow entries could provide a much better hint than basic per-VMA statistics?

With so much active development in the swap subsystem, the goal of this session is to consolidate these scattered paths, and explore whether the swap readahead mechanism can share common, useful infrastructure.

Author

Kairui Song (Tencent)

Presentation materials

There are no materials yet.