zswap
zswap is a Linux compressed-memory cache for swap pages that can defer writes to a backing swap device.
The swap subsystem offers pages to a dynamically allocated compressed pool; zswap is not a separate block device. Eviction can send pages to backing swap, so enabling the cache does not guarantee zero storage writes. Compression uses CPU time, and its benefit depends on the workload. [1]
Disabling zswap at runtime stops new stores but does not immediately empty existing compressed entries. Cached pages remain until invalidated or faulted back into memory. [1]
Accounting consequence: each cached page retains a swap entry identified by its swap type and offset. The compressed pool therefore does not add swap address capacity to the configured backing area. [1]
Relations
Citations
Sources & caveats
- Linux 6.12 documentation: overview and design sections. Configuration and distribution defaults may differ.
- The capacity distinction is inferred from the documented swap-entry-to-pool mapping, not from a capacity or memory-pressure experiment.