linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chris Li <chrisl@kernel.org>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,  linux-mm@kvack.org,
	Yosry Ahmed <yosryahmed@google.com>,
	Nhat Pham <nphamcs@gmail.com>,
	 "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Chengming Zhou <zhouchengming@bytedance.com>,
	 Barry Song <v-songbaohua@oppo.com>
Subject: Re: [PATCH v9] zswap: replace RB tree with xarray
Date: Tue, 26 Mar 2024 14:03:05 -0700	[thread overview]
Message-ID: <CANeU7QkSe6f3_81HOY4OeSk=Q+uZiEgks0vdhs7Xryjexusg+Q@mail.gmail.com> (raw)
In-Reply-To: <20240326204836.GC229434@cmpxchg.org>

On Tue, Mar 26, 2024 at 1:48 PM Johannes Weiner <hannes@cmpxchg.org> wrote:
>
> On Tue, Mar 26, 2024 at 11:35:43AM -0700, Chris Li wrote:
> >       /*
> > -      * When reading into the swapcache, invalidate our entry. The
> > +      * When reading into the swapcache, erase our entry. The
> >        * swapcache can be the authoritative owner of the page and
> >        * its mappings, and the pressure that results from having two
> >        * in-memory copies outweighs any benefits of caching the
>
> Not sure why you editorialized this? Your patch doesn't change those
> semantics, for which "invalidation" of the backing copy is a much
> better description, given we're also marking the folio dirty again etc.

I was thinking the zswap_invalidate_entry function was deleted now. So
I use the erase to match the xa_erase().
>
> Can you please send a delta fix to undo that?

Sure.

Chris

>
> > @@ -1649,8 +1581,12 @@ bool zswap_load(struct folio *folio)
> >        * the fault fails. We remain the primary owner of the entry.)
> >        */
> >       if (swapcache)
> > -             zswap_rb_erase(&tree->rbroot, entry);
> > -     spin_unlock(&tree->lock);
> > +             entry = xa_erase(tree, offset);
> > +     else
> > +             entry = xa_load(tree, offset);
> > +
> > +     if (!entry)
> > +             return false;
> >
> >       if (entry->length)
> >               zswap_decompress(entry, page);
>
> Otherwise, looks good to me
>
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
>


      reply	other threads:[~2024-03-26 21:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26 18:35 Chris Li
2024-03-26 18:42 ` Chris Li
2024-03-26 18:48   ` Yosry Ahmed
2024-03-26 21:04   ` Nhat Pham
2024-03-26 21:20     ` Chris Li
2024-03-26 20:48 ` Johannes Weiner
2024-03-26 21:03   ` Chris Li [this message]

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='CANeU7QkSe6f3_81HOY4OeSk=Q+uZiEgks0vdhs7Xryjexusg+Q@mail.gmail.com' \
    --to=chrisl@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=v-songbaohua@oppo.com \
    --cc=willy@infradead.org \
    --cc=yosryahmed@google.com \
    --cc=zhouchengming@bytedance.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