Skip to content

Replace zram+swap hybrid with zswap for proper tiered memory management #181

@AstolfoKawaii

Description

@AstolfoKawaii

Running zram alongside disk swap can cause LRU inversion - cold pages lock up fast RAM while active data spills to slow disk. This happens because Linux is unable to evict pages from zram to disk (zram is just a block device, not integrated into the broader swap ecosystem).

I suggest replacing zram with zswap because it would create a proper tiered memory layout: RAM -> compressed RAM -> swap. Unlike zram, zswap is integrated with the kernel's memory management subsystem, allowing it to distinguish between hot and cold data and automatically evict stale pages to disk when the compressed pool fills.

If my judgement is correct I'll likely be able to provide patches.

Reference: https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions