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: <CAJD7tkb3GO7yiYp4NHApyRHyg_kzaPuMQPvkvS0aUzUHkPkNzg@mail.gmail.com>
Date:   Tue, 30 May 2023 16:56:49 -0700
From:   Yosry Ahmed <yosryahmed@...gle.com>
To:     Johannes Weiner <hannes@...xchg.org>
Cc:     Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Seth Jennings <sjenning@...hat.com>,
        Dan Streetman <ddstreet@...e.org>,
        Vitaly Wool <vitaly.wool@...sulko.com>,
        Nhat Pham <nphamcs@...il.com>,
        Domenico Cerasuolo <cerasuolodomenico@...il.com>,
        Yu Zhao <yuzhao@...gle.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: zswap: support exclusive loads

On Tue, May 30, 2023 at 4:54 PM Johannes Weiner <hannes@...xchg.org> wrote:
>
> On Tue, May 30, 2023 at 09:02:51PM +0000, Yosry Ahmed wrote:
> > @@ -216,8 +216,13 @@ int __frontswap_load(struct page *page)
> >
> >       /* Try loading from each implementation, until one succeeds. */
> >       ret = frontswap_ops->load(type, offset, page);
> > -     if (ret == 0)
> > +     if (ret == 0) {
> >               inc_frontswap_loads();
> > +             if (frontswap_ops->exclusive_loads) {
> > +                     SetPageDirty(page);
> > +                     __frontswap_clear(sis, offset);
> > +             }
>
> Somewhat tangential, but is there still a point to the frontswap
> layer? It seems usecases other than zswap have never materialized, at
> least not in tree. Life would be a lot easier if we were to just
> hardcode the zswap callbacks in the swap functions.
>
> It's not the patch's fault, but it highlights the boiler plate the
> indirection causes. ->load() already has the page and could just dirty
> it directly. Instead now both layers have to handle invalidation,
> which is a vector for bugs.
>
> Can somebody think of reasons to keep it? If not, I'd take a stab at
> removing it.

I was intending to eventually remove it as part of the swap
abstraction proposal I am working on, but this will take some time. If
you want to remove it now, even better :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ