Modernizing swapping: virtual swap spaces

Linux’s new ‘virtual swap’ aims to stop freezes—users ask, why can’t it be like Windows

TLDR: Linux is testing a virtual swap space that decouples memory from specific drives and makes zswap leaner. Commenters cheered the cleanup but argued over desktop freezes, the OOM killer, and why Linux still trails Windows/macOS on built-in compression—because responsiveness, not just architecture, is what users feel.

Linux devs are rolling out a virtual swap space—a new layer that makes swapped-out memory pages no longer tied to a single drive. Translation: easier drive removal, fewer slow “housekeeping” scans, and a big win for zswap, the feature that compresses data in RAM so you don’t hit the disk. The hot promise: stop wasting disk space just to be ready “in case,” and keep memory juggling smarter.

The crowd, though, came in swinging. Numerlor dropped a bomb: Windows stays snappy even while hurling gigabytes to swap, while Linux turns into molasses. Cue memes about the cursor becoming a slideshow and the Close button being purely decorative. robinsonb5 lit up the Out-Of-Memory (OOM) killer debate: “let the user choose what dies” and keep the UI alive long enough to click something. Meanwhile, anthk went full “tune your rig,” preaching ZRAM (compressed RAM) and per-user limits, basically saying Linux can be fine if you set it up right. ChocolateGod asked the question everyone’s thinking: why doesn’t Linux just do built-in page compression like Windows/macOS?

So while devs ship a cleaner swap design, the comment war rages: is the fix about architecture, or about giving desktops the responsiveness users expect?

Key Points

  • Current swap design uses per-device swap tables and 64-bit swap entries binding pages to specific swap devices.
  • Device removal requires scanning and updating all relevant page-table entries, which is slow.
  • Zswap currently must pre-allocate backing-device slots to keep swap-ins fast, wasting storage when disk use is undesired.
  • Nhat Pham proposes a single, device-independent virtual swap space replacing per-device tables.
  • The design introduces a swp_desc structure to map swap entries to either a physical swap slot or a zswap object, decoupling pages from specific devices.

Hottest takes

"Windows remains mostly fully responsive even when swapping gigabytes per second" — Numerlor
"In a sane world the user would decide which application to shut down, not the OS" — robinsonb5
"Is there a reason as to why Linux has not adopted straight up page compression like Windows and macOS?" — ChocolateGod
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.