Re: [PATCH v3 10/11] zram: use rw_semaphore for decompression streams

From: Barry Song

Date: Thu Oct 15 2026 - 23:11:07 EST


On Fri, Oct 16, 2026 at 10:51 AM Sergey Senozhatsky
<senozhatsky@xxxxxxxxxxxx> wrote:
>
> On (26/10/15 19:24), Bo Zhang wrote:
> > On Thu, 15 Oct 2026 12:19:49 +0900 Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx> wrote:
> > > Or perhaps we can avoid vm_map/unmap. A slightly different approach.
> > > kmalloc on fast path + memcpy (zsmalloc objects are strictly less than
> > > PAGE_SIZE bytes)
> >
> > I applied the kmalloc+memcpy variant on-device and re-ran the same
> > Android A/B. It removes the exclusive path entirely in our workload.
> >
> > 9+10 9+10 + kmalloc fastpath
> > read contended ~1,959 0
> > read wait_ns total ~12 s 0
> > read wait_ns max 72-96 ms 0
> > shared 76.7% 100%
> > exclusive 23.3% 0%
> > dpin_contended 0 0
> >
> > Every decompression now takes the shared (down_read) path, including the
> > cross-page objects that previously had to go exclusive. The ~1,959
> > residual contentions on the exclusive path are gone, and pin contention
> > stays at zero, so the full read side runs concurrently with no stream
> > contention.
> >
> > Read-side contention end to end:
> >
> > baseline 9+10 9+10 + kmalloc
> > read contended 24,749 ~1,959 0
> > shared 0% 76.7% 100%
>
> Thank you. I'll include kmalloc patch to v4 of the series.

Hi Sergey, Bo,

I assume when Sergey sent v4, could tag for the patchset with

Tested-by: Bo Zhang <zhangbo56@xxxxxxxxxx>

?

also, Bo's data can be put in cover-letter?