Re: [PATCH v6 09/13] zram: split zcomp into separate R/W streams

From: Sergey Senozhatsky

Date: Fri Oct 23 2026 - 01:04:00 EST


On (26/10/22 19:11), Hillf Danton wrote:
[..]
> What I am confused is -- why decompression needs to run faster without boosting
> compression up. Where is the compressed material?

In a typical embedded device (e.g. android) zram write is swap-out
(direct, indirect kswapd, or backgroud service swapping out idle apps),
users don't see those. zram read, on the contrary, is what users
see - because that's swap-in, read bursts when user brings back idle
app (camera app, etc.) which needs to get back to foregound quickly.
So, the read path is more important.

I tested the series against PE.

readers vs readers (no writers) 3 runs

BASE+PE IOPS 1,449k avg 3.48us sd 155.6us p99.99 26.8us max 280,820us
IOPS 1,435k avg 3.69us sd 322.9us p99.99 24.2us max 540,512us
IOPS 1,459k avg 3.46us sd 92.8us p99.99 25.5us max 172,186us
PATCHED+PE IOPS 1,457k avg 3.31us sd 15.9us p99.99 25.5us max 7,580us
IOPS 1,475k avg 3.28us sd 14.6us p99.99 24.5us max 7,327us
IOPS 1,463k avg 3.32us sd 17.2us p99.99 28.5us max 6,816us

R/W stream split makes sense for reasons that we already mentioned.
Readers don't need to be blocked on Writers - they don't compete for
the same data. And, moreover, readers don't need to be serialized at
all for stateful decompression.

writers vs readers 3 runs

BASE+PE IOPS 1,271k avg 5.57us sd 1,393us p99.99 27.5us max 1,581,800us
IOPS 1,461k avg 3.43us sd 78us p99.99 23.9us max 227,015us
IOPS 1,444k avg 3.48us sd 222us p99.99 23.9us max 592,628us
PATCHED+PE IOPS 1,457k avg 3.32us sd 18us p99.99 27.5us max 5,620us
IOPS 1,464k avg 3.31us sd 17us p99.99 24.2us max 5,621us
IOPS 1,475k avg 3.29us sd 16us p99.99 26.5us max 5,620us

And, in addition, R/W streams split saves per-CPU memory.