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

From: Sergey Senozhatsky

Date: Mon Oct 19 2026 - 01:56:08 EST


On (26/10/16 21:48), Bo Zhang wrote:
> On Fri, 16 Oct 2026 17:54:25 +0900 Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx> wrote:
> > A quick and dirty patch, as usual, just to play around with. This
> > attempts to improve the reader side, because the reader is side
> > much more sensitive. Tested only with zstd.
>
> I applied the cross-CPU borrowing patch on-device and re-ran the same
> zstd Android A/B, so it can be compared against the preempt-disable
> numbers I posted earlier. Focusing on the read (exclusive decompression)
> side, which is what this patch targets:
>
> 9+10+kmalloc preempt-disable cross-CPU borrow
> dexcl_contended 15,919 54 1,447
> dexcl_wait_ns_total 109.6 s 0.68 s 3.66 s
> dexcl_wait_ns_max 145 ms 34.6 ms 26.6 ms
> dexcl_avg_wait 6.88 ms 12.6 ms 2.53 ms
> dexcl_acquire 2.21M 2.75M 2.94M
>
> Borrowing clearly works: dexcl contention drops 15,919 -> 1,447 (-91%),
> and the residual 1,447 are the genuinely all-CPUs-busy cases that fall
> through to wait_event(). More importantly for us, the worst case and the
> average are the best of the three - max 145ms -> 26.6ms (-82%), avg down
> to 2.53ms.

Thank you Bo! I included your numbers into the commit message.