lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKEwX=PurvxHEvyy6tTNxTXVvhUN3Fz=EURb5h0-u7H=pL8UYA@mail.gmail.com>
Date: Fri, 28 Feb 2025 18:08:16 -0800
From: Nhat Pham <nphamcs@...il.com>
To: Yosry Ahmed <yosry.ahmed@...ux.dev>
Cc: akpm@...ux-foundation.org, hannes@...xchg.org, chengming.zhou@...ux.dev, 
	linux-mm@...ck.org, kernel-team@...a.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] zswap: do not crash the kernel on decompression failure

On Thu, Feb 27, 2025 at 1:55 PM Yosry Ahmed <yosry.ahmed@...ux.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@...ux.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. :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ