From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
Nhat Pham <nphamcs@gmail.com>,
Yosry Ahmed <yosryahmed@google.com>,
akpm@linux-foundation.org, hannes@cmpxchg.org,
cerasuolodomenico@gmail.com, sjenning@redhat.com,
ddstreet@ieee.org, vitaly.wool@konsulko.com, hughd@google.com,
corbet@lwn.net, konrad.wilk@oracle.com, rppt@kernel.org,
linux-mm@kvack.org, kernel-team@meta.com,
linux-kernel@vger.kernel.org, david@ixit.cz,
Minchan Kim <minchan@kernel.org>,
Shakeel Butt <shakeel.butt@linux.dev>,
Chengming Zhou <chengming.zhou@linux.dev>,
Kairui Song <ryncsn@gmail.com>
Subject: Re: [PATCH 0/2] minimize swapping on zswap store failure
Date: Tue, 8 Apr 2025 12:33:37 +0900 [thread overview]
Message-ID: <jbf64ctbcquh3jvcoioszpiw4ucdxs3olr45fwtfgobifwxw27@mcxxyyji4ltb> (raw)
In-Reply-To: <20250404140628.2049848-1-joshua.hahnjy@gmail.com>
Hi,
Sorry for the delay
On (25/04/04 07:06), Joshua Hahn wrote:
> On Fri, 4 Apr 2025 10:46:22 +0900 Sergey Senozhatsky <senozhatsky@chromium.org> wrote:
>
> > On (25/04/03 13:38), Nhat Pham wrote:
> > > > Ultimately the goal is to prevent an incompressible page from hoarding the
> > > > compression algorithm on multiple reclaim attempts, but if we are spending
> > > > more time by allocating new pages... maybe this isn't the correct approach :(
> > >
> > > Hmmm, IIUC this problem also exists with zram, since zram allocates a
> > > PAGE_SIZE sized buffer to hold the original page's content. I will
> > > note though that zram seems to favor these kinds of pages for
> > > writeback :) Maybe this is why...?
> >
> > zram is a generic block device, it must store whatever comes in,
> > compressible or incompressible. E.g. when we have, say, ext4
> > running atop of the zram device we cannot reject page stores.
> >
> > And you are right, when we use zram for swap, there is some benefit
> > in storing incompressible pages. First, those pages are candidates
> > for zram writeback, which achieves the goal of removing the page from
> > RAM after all, we give up on the incompressible page reclamation with
> > "return it back to LRU" approach. Second, on some zram setups we do
> > re-compression (with a slower and more efficient algorithm) and in
> > certain number of cases what is incompressible with the primary (fast)
> > algorithm is compressible with the secondary algorithm.
>
> Hello Sergey,
>
> Thank you for your insight, I did not know this is how zram handled
> incompressible pages.
Well, yes, zram doesn't have a freedom to reject writes, to the
fs/vfs that would look like a block device error.
[..]
> On the note of trying a second compression algorithm -- do you know how much
> of the initially incompressible pages get compressed later?
So I don't recall the exact numbers, but, if I'm not mistaken, in
my tests (on chromeos) I think I saw something like 20+% (a little
higher than just 20%) success rate (successful re-compression with
a secondary algorithm), but like you said this is very data patterns
specific.
> Thank you again for your response! Have a great day : -)
Thanks, you too!
next prev parent reply other threads:[~2025-04-08 3:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-17 0:35 Nhat Pham
2023-10-17 0:35 ` [PATCH 1/2] swap: allows swap bypassing " Nhat Pham
2023-10-17 0:35 ` [PATCH 2/2] zswap: store uncompressed pages when compression algorithm fails Nhat Pham
2023-10-17 0:57 ` [PATCH 0/2] minimize swapping on zswap store failure Yosry Ahmed
2023-10-17 4:47 ` Johannes Weiner
2023-10-17 5:33 ` Yosry Ahmed
2023-10-17 14:51 ` Johannes Weiner
2023-10-17 15:51 ` Yosry Ahmed
2023-10-17 19:24 ` Nhat Pham
2023-10-17 19:03 ` Nhat Pham
2023-10-17 19:04 ` Nhat Pham
2025-04-02 20:06 ` Joshua Hahn
2025-04-03 20:38 ` Nhat Pham
2025-04-04 1:46 ` Sergey Senozhatsky
2025-04-04 14:06 ` Joshua Hahn
2025-04-04 15:29 ` Nhat Pham
2025-04-08 3:33 ` Sergey Senozhatsky [this message]
2025-04-04 15:39 ` Nhat Pham
2025-04-22 11:27 ` Yosry Ahmed
2025-04-22 15:00 ` Joshua Hahn
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=jbf64ctbcquh3jvcoioszpiw4ucdxs3olr45fwtfgobifwxw27@mcxxyyji4ltb \
--to=senozhatsky@chromium.org \
--cc=akpm@linux-foundation.org \
--cc=cerasuolodomenico@gmail.com \
--cc=chengming.zhou@linux.dev \
--cc=corbet@lwn.net \
--cc=david@ixit.cz \
--cc=ddstreet@ieee.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=joshua.hahnjy@gmail.com \
--cc=kernel-team@meta.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=nphamcs@gmail.com \
--cc=rppt@kernel.org \
--cc=ryncsn@gmail.com \
--cc=shakeel.butt@linux.dev \
--cc=sjenning@redhat.com \
--cc=vitaly.wool@konsulko.com \
--cc=yosryahmed@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