Re: [PATCHv2 1/7] zram: introduce compressed data writeback
From: Sergey Senozhatsky
Date: Mon Jan 12 2026 - 23:54:09 EST
Hi,
On (26/01/08 18:36), zhangdongdong wrote:
[..]
> > I don't know if solving it on zram side alone is possible. Maybe we
> > can get some help from the block layer: some sort of two-stage bio
> > submission. First stage: submit chained bio-s, second stage: iterate
> > over all submitted and completed bio-s and decompress the data. Again,
> > just thinking out loud.
> >
>
> Hi Sergey,
>
> My thinking is largely aligned with yours. I agree that relying on zram
> alone is unlikely to fully solve this problem, especially without going
> back to atomic read/write.
>
> Our current mitigation approach is to introduce a hook at the swap layer
> and move decompression there. By doing so, decompression happens in a
> fully sleepable context, which avoids the atomic-context constraints
> you outlined. This helps us sidestep the core issue rather than trying
> to force decompression back into zram completion paths.
This approach is limited to swap use-cases only, while zram
is a generic block device: one can mkfs on it and use it as
a normal block device. So, this is not a complete solution.
[..]
> If I recall correctly, this issue first became noticeable after a block
> layer change was merged; I can try to dig that up and share more details
> later.
Interesting.