From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Brian Geffon <bgeffon@google.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>,
Barry Song <baohua@kernel.org>, Bo Zhang <zhangbo0325@gmail.com>,
Minchan Kim <minchan@kernel.org>,
Richard Chang <richardycc@google.com>,
linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH v6 09/13] zram: split zcomp into separate R/W streams
Date: Mon, 26 Oct 2026 12:09:32 +0900 [thread overview]
Message-ID: <at7ECnijIur1XOAG@google.com> (raw)
In-Reply-To: <CADyq12xeONu-+YRP79KaH4XCsSrNK5DdoKw6T5YSEyW7Acxh7w@mail.gmail.com>
On (26/10/23 13:05), Brian Geffon wrote:
> On Tue, Oct 20, 2026 at 10:43 PM Sergey Senozhatsky
> <senozhatsky@chromium.org> wrote:
> >
> > Split struct zcomp_strm into separate compression (Write zcomp_cstrm)
> > and decompression (Read zcomp_dstrm) streams, and split zcomp_ops
> > context creation/destruction into create_cctx/destroy_cctx and
> > optional create_dctx/destroy_dctx callbacks.
> >
> > This decouples Read (decompression) and Write (compression) paths so
> > they no longer contend on the same per-CPU stream mutex (Writer vs
> > Reader priority inversion). Currently, a (low priority) Writer that
> > holds the stream mutex can be preempted by a (higher priority) Reader
> > on the same CPU, which then blocks on that mutex until the Writer gets
> > to run again and releases it, which can take a long time when there
> > are other runnable tasks on that CPU. The good news is that Read and
> > Write contexts are completely independent - compression uses its own
> > scratch buffer that decompression never touches, and decompression
> > uses its own local buffer (for spanning zsmalloc objects) that
> > compression never touches, so the Read/Write context split doesn't
> > noticeably increase memory usage. In addition many S/W backends have
> > stateless decompression contexts.
> >
> > A quick synthetic fio test for Writer vs Reader inversion on 24 CPUs
> > (preempt=full, zstd, 48 low priority (nice 19) writers, 24 normal
> > priority (nice 0) CPU hogs and 24 high priority (nice -19) readers):
> >
> > Metric Base Patched
> > ----------------------------------------------------------
> > Read IOPS 207k 1,150k (+5.6x)
> > Read clat avg 101.50 us 7.76 us (-13.1x)
> > Read clat stdev 5,615.90 us 30.78 us (-182x)
> > Read clat p99.99 258,998 us 111.10 us (-2331x)
> > Read clat max 1,342,600 us 11,217 us (-120x)
>
> These results are awesome and thanks for exploring other options. I
> agree this sounds like a great path forward.
>
> >
> > Suggested-by: Barry Song <baohua@kernel.org>
> > Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
>
> Acked-by: Brian Geffon <bgeffon@google.com>
Thank you, sir!
next prev parent reply other threads:[~2026-10-26 3:09 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 2:42 [PATCH v6 00/13] zram: redesign zcomp and rework backends Sergey Senozhatsky
2026-10-21 2:42 ` [PATCH v6 01/13] zram: prefix backends printk-s Sergey Senozhatsky
2026-10-21 2:42 ` [PATCH v6 02/13] zram: remove debugfs entry on init failure Sergey Senozhatsky
2026-10-21 2:42 ` [PATCH v6 03/13] zram: reset writeback state in zram_reset_device() Sergey Senozhatsky
2026-10-21 2:42 ` [PATCH v6 04/13] zram: zstd: do not allocate empty C/D-dictionaries Sergey Senozhatsky
2026-10-21 2:42 ` [PATCH v6 05/13] zram: lz4hc: pre-initialize dictionary stream in setup_params Sergey Senozhatsky
2026-10-21 2:42 ` [PATCH v6 06/13] zram: lz4: use LZ4_decompress_safe_usingDict() Sergey Senozhatsky
2026-10-21 2:42 ` [PATCH v6 07/13] zram: lz4hc: " Sergey Senozhatsky
2026-10-21 2:42 ` [PATCH v6 08/13] zram: zstd: do not use kvzalloc() for zstd allocations Sergey Senozhatsky
2026-10-21 2:42 ` [PATCH v6 09/13] zram: split zcomp into separate R/W streams Sergey Senozhatsky
2026-10-21 4:23 ` Hillf Danton
2026-10-21 4:56 ` Sergey Senozhatsky
2026-10-21 7:53 ` Hillf Danton
2026-10-22 0:08 ` Hillf Danton
2026-10-22 0:19 ` Barry Song
2026-10-22 11:11 ` Hillf Danton
2026-10-23 5:01 ` Sergey Senozhatsky
2026-10-23 11:40 ` Hillf Danton
2026-10-24 5:48 ` Sergey Senozhatsky
2026-10-24 10:14 ` Hillf Danton
2026-10-25 1:11 ` Hillf Danton
2026-10-25 1:38 ` Sergey Senozhatsky
2026-10-25 10:54 ` Hillf Danton
2026-10-22 2:06 ` Sergey Senozhatsky
2026-10-22 23:25 ` Hillf Danton
2026-10-23 3:29 ` Sergey Senozhatsky
2026-10-23 17:05 ` Brian Geffon
2026-10-26 3:09 ` Sergey Senozhatsky [this message]
2026-10-21 2:42 ` [PATCH v6 10/13] zram: introduce shared decompression streams Sergey Senozhatsky
2026-10-21 2:42 ` [PATCH v6 11/13] zram: allocate bounce buffer for spanning objects Sergey Senozhatsky
2026-10-21 2:42 ` [PATCH v6 12/13] zram: borrow idle decompression streams in exclusive mode Sergey Senozhatsky
2026-10-21 2:42 ` [PATCH v6 13/13] zram: use a singleton compression context for recompression Sergey Senozhatsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=at7ECnijIur1XOAG@google.com \
--to=senozhatsky@chromium.org \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=bgeffon@google.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=richardycc@google.com \
--cc=zhangbo0325@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.