[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250731181630.GB1055539@cmpxchg.org>
Date: Thu, 31 Jul 2025 14:16:30 -0400
From: Johannes Weiner <hannes@...xchg.org>
To: SeongJae Park <sj@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Chengming Zhou <chengming.zhou@...ux.dev>,
Nhat Pham <nphamcs@...il.com>, Takero Funaki <flintglass@...il.com>,
Yosry Ahmed <yosry.ahmed@...ux.dev>, kernel-team@...a.com,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [RFC PATCH] mm/zswap: store compression failed page as-is
On Thu, Jul 31, 2025 at 10:09:22AM -0700, SeongJae Park wrote:
> On Thu, 31 Jul 2025 11:27:01 -0400 Johannes Weiner <hannes@...xchg.org> wrote:
> > So if compression fails, still do zpool_malloc(), but for PAGE_SIZE
> > and copy over the uncompressed page contents.
> >
> > struct zswap_entry has a hole after bool referenced, so you can add a
> > flag to mark those uncompressed entries at no extra cost.
> >
> > Then you can detect this case in zswap_decompress() and handle the
> > uncompressed copy into @folio accordingly.
>
> I think we could still use 'zswap_entry->length == PAGE_SIZE' as the indicator,
> As long as we ensure that always means the content is incompressed, following
> Nhat's suggestion[1].
>
> Please let me know if I'm missing something.
Ah, right. So if compression succeeds but the result is still
PAGE_SIZE you will treat it as failure and store it uncompressed. Then
PAGE_SIZE always means uncompressed for the readers.
Even better.
Powered by blists - more mailing lists