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

From: Hillf Danton

Date: Fri Oct 23 2026 - 07:41:41 EST


On Fri, 23 Oct 2026 14:01:32 +0900 Sergey Senozhatsky wrote:
> 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.
>
Thanks for sharing data.

> 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
>
BASE+PE IOPS 1,449k
IOPS 1,435k
IOPS 1,459k
+)----------
4,343
/3)----------
1,447

PATCHED+PE IOPS 1,457k
IOPS 1,475k
IOPS 1,463k
+)----------
4,395
/3)----------
1,465

(1,465 - 1,447) / 1,447 = 18 / 1,447 = 1%


> 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
>
BASE+PE IOPS 1,271k
IOPS 1,461k
IOPS 1,444k
+)----------
4,176
/3)----------
1,392

PATCHED+PE IOPS 1,457k
IOPS 1,464k
IOPS 1,475k
+)----------
4,396
/3)----------
1,465

(1,465 - 1,392) / 1,392 = 73 / 1,392 = 5%


improvment within 5% more than 10% more than 20%
(mIngo's) rule safely ignored good standing ovation

More than two miles away from standing ovation.