New Patches For Linux's Zswap Show Major Improvements
Amid multiple ongoing innovations being pursued in the Linux memory management space amid sky high RAM prices, a new patch series posted on Monday aim to enhance the Zswap performance for this compressed RAM cache for swap pages...
New patches for Linux's Zswap introduce significant improvements by separating compression and decompression into distinct requests and mutexes. This change prevents higher-priority loads from waiting for ongoing stores, as a low-priority store can be preempted before releasing the zswap mutex. Additionally, asynchronous algorithms now decompress using an on-stack request when the algorithm is synchronous, eliminating the need for the Zswap lock.
The patches allocate a similar number of requests as before, with each per-CPU context growing by 72 bytes. While the load path is approximately 270 bytes deeper on x86-64, the overall impact on performance is notable. Benchmark tests demonstrate that with one virtual CPU, read times drop from 22.3ms to just 0.97ms, and with eight virtual CPUs, read times reduce from an average of 314ms to 7.0ms.
These improvements result in a substantial decrease in the likelihood of reads taking over 10 milliseconds, with single-vCPU scenarios seeing a complete elimination of reads over that threshold, and multi-vCPU scenarios seeing a reduction from 3-18 instances to at most one. The benchmarking methodology, developed with assistance from an LLM, confirms the substantial performance enhancements provided by these new Zswap patches.
Written by urgent.news from Phoronix's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.