From: Nhat Pham <nphamcs@gmail.com>
To: Yosry Ahmed <yosry.ahmed@linux.dev>
Cc: akpm@linux-foundation.org, hannes@cmpxchg.org,
chengming.zhou@linux.dev, linux-mm@kvack.org,
kernel-team@meta.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] zswap: do not crash the kernel on decompression failure
Date: Fri, 28 Feb 2025 18:08:16 -0800 [thread overview]
Message-ID: <CAKEwX=PurvxHEvyy6tTNxTXVvhUN3Fz=EURb5h0-u7H=pL8UYA@mail.gmail.com> (raw)
In-Reply-To: <Z8DfQahDy7ig643i@google.com>
On Thu, Feb 27, 2025 at 1:55 PM Yosry Ahmed <yosry.ahmed@linux.dev> wrote:
>
> On Thu, Feb 27, 2025 at 01:46:29PM -0800, Nhat Pham wrote:
> > On Wed, Feb 26, 2025 at 5:19 PM Yosry Ahmed <yosry.ahmed@linux.dev> wrote:
> > >
> > > On Wed, Feb 26, 2025 at 04:14:45PM -0800, Nhat Pham wrote:
> > > > Currently, we crash the kernel when a decompression failure occurs in
> > > > zswap (either because of memory corruption, or a bug in the compression
> > > > algorithm). This is overkill. We should only SIGBUS the unfortunate
> > > > process asking for the zswap entry on zswap load, and skip the corrupted
> > > > entry in zswap writeback. The former is accomplished by returning true
> > > > from zswap_load(), indicating that zswap owns the swapped out content,
> > > > but without flagging the folio as up-to-date. The process trying to swap
> > > > in the page will check for the uptodate folio flag and SIGBUS (see
> > > > do_swap_page() in mm/memory.c for more details).
> > >
> > > We should call out the extra xarray walks and their perf impact (if
> > > any).
> >
> > Lemme throw this in a quick and dirty test. I doubt there's any
> > impact, but since I'm reworking this patch for a third version anyway
> > might as well.
>
> It's likely everything is cache hot and the impact is minimal, but let's
> do the due diligence.
>
Yeah I ran some kernel building tests for 5 times, and found basically
no difference:
With the new scheme:
real: mean: 125.1s, stdev: 0.12s
user: mean: 3265.23s, stdev: 9.62s
sys: mean: 2156.41s, stdev: 13.98s
The old scheme:
real: mean: 125.78s, stdev: 0.45s
user: mean: 3287.18s, stdev: 5.95s
sys: mean: 2177.08s, stdev: 26.52s
Honestly, eyeballing the results, the mean difference is probably
smaller than between-run variance. :)
next prev parent reply other threads:[~2025-03-01 2:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-27 0:14 Nhat Pham
2025-02-27 1:19 ` Yosry Ahmed
2025-02-27 4:31 ` Johannes Weiner
2025-02-27 5:44 ` Yosry Ahmed
2025-02-27 6:16 ` Johannes Weiner
2025-02-27 7:11 ` Yosry Ahmed
2025-02-27 7:29 ` Yosry Ahmed
2025-02-27 16:05 ` Johannes Weiner
2025-02-27 18:01 ` Yosry Ahmed
2025-02-27 22:35 ` Nhat Pham
2025-02-27 21:46 ` Nhat Pham
2025-02-27 21:55 ` Yosry Ahmed
2025-03-01 2:08 ` Nhat Pham [this message]
2025-03-01 2:20 ` Yosry Ahmed
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='CAKEwX=PurvxHEvyy6tTNxTXVvhUN3Fz=EURb5h0-u7H=pL8UYA@mail.gmail.com' \
--to=nphamcs@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=yosry.ahmed@linux.dev \
/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