News report

Linux ZRAM Rework Splits Read and Write Compression Streams

A proposed Linux ZRAM redesign separates compression and decompression streams to reduce priority inversion and cut per-CPU memory overhead.

On this page
  1. ZRAM's compression contexts are being redesigned
  2. The redesign can also reduce memory overhead
  3. Performance claims remain preliminary

ZRAM's compression contexts are being redesigned

Sergey Senozhatsky of Google's Chrome/Chromium team has posted a Linux kernel patch series that reworks ZRAM's zcomp compression layer. The central change separates per-CPU read and write streams instead of making compression and decompression share the same stream and lock.

The patch rationale targets a priority-inversion case in preemptible ZRAM: a higher-priority reader can preempt a writer that already holds the shared stream lock, then block waiting for that same lock. Because decompression and compression use independent buffers, the proposal gives reads and writes separate contexts so they no longer compete for one stream.

What the proposed ZRAM stream redesign changes
AreaCurrent/shared-stream issueProposed behavior
Read vs. write contextsCompression and decompression share per-CPU streamsSeparate per-CPU read and write streams
SchedulingA reader can be blocked behind a preempted writer holding the stream lockIndependent streams remove that specific lock contention
RecompressionSecondary compression contexts are allocated per CPUA singleton compression context can serve serialized recompression while decompression remains per CPU
Memory overheadSecondary contexts multiply with CPU countSome backends/configurations can save tens to hundreds of KB per context/per CPU

The redesign can also reduce memory overhead

The final part of the series changes how secondary streams used for recompression are allocated. Recompression is serialized by the device lock, so the proposal can use one compression context for that work while retaining per-CPU decompression contexts for concurrent reads.

Senozhatsky says the resulting savings range from double-digit to triple-digit kilobytes per context and per CPU in some configurations, with backends such as zstd, deflate and lz4hc called out as examples where the reduction can be notable. On machines with many CPU cores, per-CPU savings can accumulate, but the exact total depends on the compressor and configuration.

Performance claims remain preliminary

The patch author reports noticeable improvements in synthetic testing after decoupling read and write streams. That result is useful evidence for the mechanism, but it is not a universal application-performance claim: real-world impact will depend on workload, memory pressure, compressor choice, CPU topology and how heavily ZRAM is exercised.

The work was posted for review on October 5, 2026. It is therefore proposed upstream kernel development rather than functionality users should assume is present in their current distribution kernel. The currently listed mainline kernel is Linux 7.3-rc6, so this story should not be read as a released Linux 7.3 feature.

Sources

Primary and technical sources

These sources support the reporting and analysis above. Current stories are updated when later evidence materially changes the facts.

  1. 01 Phoronix

    Linux's ZRAM Reworked For Greater Memory Savings, Better Performance
  2. 02 Linux kernel mailing list / Sergey Senozhatsky

    ZRAM zcomp redesign patch series, October 5, 2026
  3. 03 Kernel.org

    Linux kernel releases

Related