Re: [PATCH 1/2] zram: introduce compressed data writeback

From: Barry Song

Date: Mon Dec 01 2025 - 03:59:41 EST


On Mon, Dec 1, 2025 at 11:56 AM Sergey Senozhatsky
<senozhatsky@xxxxxxxxxxxx> wrote:
[...]
> > > 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).

Thanks, Sergey. That makes sense to me. On Android, users don’t have a
close button, yet apps can still be OOM-killed; those pages are never
swapped in.

Thanks
Barry