From: zhangdongdong <zhangdongdong925@sina.com>
To: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Richard Chang <richardycc@google.com>,
Minchan Kim <minchan@kernel.org>,
Brian Geffon <bgeffon@google.com>,
David Stevens <stevensd@google.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-block@vger.kernel.org, Minchan Kim <minchan@google.com>
Subject: Re: [PATCHv2 1/7] zram: introduce compressed data writeback
Date: Wed, 7 Jan 2026 15:28:03 +0800 [thread overview]
Message-ID: <2663a3d3-2d52-4269-970a-892d71c966bb@sina.com> (raw)
In-Reply-To: <7bnmkuodymm33yclp6e5oir2sqnqmpwlsb5qlxqyawszb5bvlu@l63wu3ckqihc>
On 1/7/26 12:28, Sergey Senozhatsky wrote:
> On (26/01/07 11:50), zhangdongdong wrote:
>> Hi Sergey,
>>
>> Thanks for the work on decompression-on-demand.
>>
>> One concern I’d like to raise is the use of a workqueue for readback
>> decompression. In our measurements, deferring decompression to a worker
>> introduces non-trivial scheduling overhead, and under memory pressure
>> the added latency can be noticeable (tens of milliseconds in some cases).
>
> The problem is those bio completions happen in atomic context, and zram
> requires both compression and decompression to be non-atomic. And we
> can't do sync read on the zram side, because those bio-s are chained.
> So the current plan is to look how system hi-prio per-cpu workqueue
> will handle this.
>
> Did you try high priority workqueue?
>
Hi,Sergey
Yes, we have tried high priority workqueues. In fact, our current
implementation already uses a dedicated workqueue created with
WQ_HIGHPRI and marked as UNBOUND, which handles the read/decompression
path for swap-in.
Below is a simplified snippet of the queue we are currently using:
zgroup_read_wq = alloc_workqueue("zgroup_read",
WQ_HIGHPRI | WQ_UNBOUND, 0);
static int zgroup_submit_zio_async(struct zgroup_io *zio,
struct zram_group *zgroup)
{
struct zgroup_req req = {
.zio = zio,
};
if (!zgroup_io_step_chg(zio, ZIO_STARTED, ZIO_INFLIGHT)) {
wait_for_completion(&zio->wait);
if (zio->status)
zgroup_put_io(zio);
return zio->status;
}
INIT_WORK_ONSTACK(&req.work, zgroup_submit_zio_work);
queue_work(zgroup_read_wq, &req.work);
flush_work(&req.work);
destroy_work_on_stack(&req.work);
return req.status ?: zgroup_decrypt_pages(zio);
}
Thanks,
dongdong
next prev parent reply other threads:[~2026-01-07 7:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-01 9:47 [PATCHv2 0/7] " Sergey Senozhatsky
2025-12-01 9:47 ` [PATCHv2 1/7] " Sergey Senozhatsky
2026-01-07 3:50 ` zhangdongdong
2026-01-07 4:28 ` Sergey Senozhatsky
2026-01-07 7:28 ` zhangdongdong [this message]
2026-01-07 10:14 ` Sergey Senozhatsky
2026-01-08 2:57 ` zhangdongdong
2026-01-08 3:39 ` Sergey Senozhatsky
2026-01-08 10:36 ` zhangdongdong
2025-12-01 9:47 ` [PATCHv2 2/7] zram: introduce writeback_compressed device attribute Sergey Senozhatsky
2025-12-01 9:47 ` [PATCHv2 3/7] zram: document writeback_batch_size Sergey Senozhatsky
2025-12-01 9:47 ` [PATCHv2 4/7] zram: move bd_stat to writeback section Sergey Senozhatsky
2025-12-01 9:47 ` [PATCHv2 5/7] zram: rename zram_free_page() Sergey Senozhatsky
2025-12-01 9:47 ` [PATCHv2 6/7] zram: switch to guard() for init_lock Sergey Senozhatsky
2025-12-01 9:47 ` [PATCHv2 7/7] zram: consolidate device-attr declarations 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=2663a3d3-2d52-4269-970a-892d71c966bb@sina.com \
--to=zhangdongdong925@sina.com \
--cc=akpm@linux-foundation.org \
--cc=bgeffon@google.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@google.com \
--cc=minchan@kernel.org \
--cc=richardycc@google.com \
--cc=senozhatsky@chromium.org \
--cc=stevensd@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox