From: Nhat Pham <nphamcs@gmail.com>
To: Chris Li <chrisl@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Yosry Ahmed <yosryahmed@google.com>,
Johannes Weiner <hannes@cmpxchg.org>,
"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:04:01 -0700 [thread overview]
Message-ID: <CAKEwX=MLFaA-1kYbKT0bMuTsJDqK9ZfoJ+WUyxM4tBu_owyPYA@mail.gmail.com> (raw)
In-Reply-To: <CANeU7Q=8p4whMu+H9GXqQc4Ehjt0_kCtNdg34TiW4bWFw03dbw@mail.gmail.com>
On Tue, Mar 26, 2024 at 11:42 AM Chris Li <chrisl@kernel.org> 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
> > @@ -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);
>
> This is the place I make the modification for the conflict resolution.
> It depends on the swapcache to execute xa_erase() or xa_load().
> Obviously, the xa_load() will not delete the entry from the tree.
>
The conflict resolution itself LGTM. I'll let you and Johannes decide
on the comment (but FWIW, the original meaning still holds, so I don't
see why we need to fix it).
Reviewed-by: Nhat Pham <nphamcs@gmail.com>
next prev parent reply other threads:[~2024-03-26 21:04 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 [this message]
2024-03-26 21:20 ` Chris Li
2024-03-26 20:48 ` Johannes Weiner
2024-03-26 21:03 ` Chris Li
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=MLFaA-1kYbKT0bMuTsJDqK9ZfoJ+WUyxM4tBu_owyPYA@mail.gmail.com' \
--to=nphamcs@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chrisl@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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