Hotness Fragmentation Limits Linux Proactive Reclaim: An Experimental Study of Object Placement, zswap, and cgroup v2 memory.reclaim
Abstract
Data centers reclaim memory from running jobs to fit more work on each server, but Linux decides what to reclaim one 4 KiB page at a time while applications use memory one small object at a time. Banakar et al. (2026) call the resulting waste hotness fragmentation: a single frequently used object keeps an entire page resident, together with the cold bytes around it. This paper measures how much memory that costs a stock Linux kernel. A purpose-built C workload places the same number of hot 64-byte objects in a 4 GiB arena either scattered at random or packed contiguously, and a driver reclaims memory in steps through cgroup v2 memory.reclaim into zswap with disk writeback disabled. Across 36 runs (two layouts, hot sets of 1%, 5% and 20%, lz4 and zstd compressors, three repetitions), packing saved 40.0-69.7% of memory, while scattering saved 0-37.0%. At a 5% hot set the gap was 48.0% against 1.9% with lz4. With the compression ratio measured from zswap's counters, savings matched a simple model, the fraction of pages holding no hot object times one minus the inverse compression ratio, to within one percentage point in every configuration, and to within 0.02 points when measured against the arena alone. Reclaiming cold pages caused no lasting slowdown; reclaiming beyond them evicted hot pages that faulted straight back in, costing a median 1.3-2.7 times the baseline loop time while saving nothing. Two validity problems found during pilot runs, swap readahead and shared-cache timing noise, are reported with their fixes.
Create a lesson
Metadata
- Categories
- cs.OS, cs.PF
- Comments
- 13 pages, 4 figures, 1 table
Related papers
Benchmarking Linux CGroup and Schedule Idle
Shared title terminologycs.OSAnna Arpaci-Dusseau
RetainZ: Reclaim-Time-Aware Placement for AI Checkpoints on Zoned SSDs
Shared title terminologycs.OSMinxing Chu, Ruoxi Yang
Resolving an Idle-Time Accounting Hazard in Linux Load Balancing
Shared title terminologycs.OSShubhang Kaushik
Reproducer Synthesis for AI-Reported Bugs in the Linux Kernel
Shared title terminologycs.OSXiao Wu, Yunbo Ni, Hao Sun et al.
Bring Cloud-Native Networking to FreeBSD Jails: Porting Calico from Linux
Shared title terminologycs.OSSoma Sakaguchi, Shintaro Suzuki, Yuki Nakata et al.
Restoring Fair Hrtick Re-arming After Same-Task Repicks in the Linux EEVDF Scheduler
Shared title terminologycs.OSShubhang Kaushik