Re: [PATCH 1/2] zram: introduce compressed data writeback
From: Sergey Senozhatsky
Date: Sun Nov 30 2025 - 22:56:32 EST
Hi Barry,
On (25/11/29 17:55), Barry Song wrote:
> On Sat, Nov 29, 2025 at 1:06 AM Sergey Senozhatsky
> <senozhatsky@xxxxxxxxxxxx> wrote:
> >
> > From: Richard Chang <richardycc@xxxxxxxxxx>
> >
>
> Hi Richard, Sergey,
>
> Thanks a lot for developing this. For years, people have been looking for
> compressed data writeback to reduce I/O, such as compacting multiple compressed
> blocks into a single page on block devices. I guess this patchset hasn’t reached
> that point yet, right?
Right.
> > zram stores all written back slots raw, which implies that
> > during writeback zram first has to decompress slots (except
> > for ZRAM_HUGE slots, which are raw already). The problem
> > with this approach is that not every written back page gets
> > read back (either via read() or via page-fault), which means
> > that zram basically wastes CPU cycles and battery decompressing
> > such slots. This changes with introduction of decompression
>
> If a page is swapped out and never read again, does that actually indicate
> a memory leak in userspace?
No, it just means that there is no page-fault on that page. E.g. we
swapped out an unused browser tab and never come back to it within the
session: e.g. user closed the tab/app, or logged out of session, or
rebooted the device, or simply powered off (desktop/laptop).