From: Chris Li <chrisl@kernel.org>
To: Yosry Ahmed <yosryahmed@google.com>
Cc: Chengming Zhou <zhouchengming@bytedance.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Johannes Weiner <hannes@cmpxchg.org>,
linux-mm@kvack.org, Nhat Pham <nphamcs@gmail.com>
Subject: Re: [PATCH 0/2] mm/zswap: optimize the scalability of zswap rb-tree
Date: Wed, 17 Jan 2024 16:17:51 -0800 [thread overview]
Message-ID: <CAF8kJuO=3-DMV-rXBZE-hVUXzQcV5B1HPFGzpzL99_5WggqF9Q@mail.gmail.com> (raw)
In-Reply-To: <CAJD7tkYfo6mNjHQJt4yfVuh55tMyVMRnbeq5ki42tYHBEgP_eA@mail.gmail.com>
Hi Yosry,
On Wed, Jan 17, 2024 at 3:48 PM Yosry Ahmed <yosryahmed@google.com> wrote:
>
> > Currently the xarray patch should have everything it takes to use RCU
> > read lock. However taking out the tree spinlock is more work than
> > previously. If we are going to remove the tree spinlock, I think we
> > should revert back to doing a zswap tree lookup and return the zswap
> > entry with reference increased. The tree mapping can still decouple
> > from the zswap entry reference count drop to zero. Anyway, my V1 of
> > the xarray patch will not include removing the tree spinlock.
>
> Interesting. What do you mean by removing the tree spinlock? My
> assumption was that the xarray reduces lock contention because we do
> not need a lock to do lookups, but we still need the lock otherwise.
> Did you have something in mind to completely remove the tree lock?
In my current xarray series, it adds the xarray alongside the rb tree.
Xarray has its own internal lock as well. Effectively zswap now has
two locks instead of just one previously. The xarray lock will not
have any contention due to the xarray lock taken inside the zswap rb
tree lock. The eventual goal is reducing the two locks back to
one(xarray lock), which is not in my V1 patch. Your understanding is
correct, the xarray still needs to have one lock for protecting the
write path.
> > > The reason why I think we should wait for the xarray patch(es) is
> > > there is a chance we may see less improvements from splitting the tree
> > > if it was an xarray. If we merge this series first, there is no way to
> > > know.
> > >
> > > Chris, do you intend to send the xarray patch(es) anytime soon?
> >
> > Thanks for the heads up. Let me send it out now.
>
> Awesome, thanks! I assume Chengming can test whether this series
> provides the same benefits with the xarray.
That would be great. The xarray patch needs more testing for sure.
Chris
next prev parent reply other threads:[~2024-01-18 0:18 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 9:23 Chengming Zhou
2024-01-17 9:23 ` [PATCH 1/2] mm/zswap: make sure each swapfile always have " Chengming Zhou
2024-01-18 15:05 ` Johannes Weiner
2024-01-18 17:37 ` Yosry Ahmed
2024-01-18 18:16 ` Nhat Pham
2024-01-17 9:23 ` [PATCH 2/2] mm/zswap: split " Chengming Zhou
2024-01-18 15:11 ` Johannes Weiner
2024-01-19 6:20 ` Chengming Zhou
2024-01-18 19:24 ` Nhat Pham
2024-01-19 6:24 ` Chengming Zhou
2024-01-17 18:37 ` [PATCH 0/2] mm/zswap: optimize the scalability of " Yosry Ahmed
2024-01-17 23:41 ` Chris Li
2024-01-17 23:47 ` Yosry Ahmed
2024-01-18 0:17 ` Chris Li [this message]
2024-01-18 0:34 ` Yosry Ahmed
2024-01-18 1:03 ` Chris Li
2024-01-18 3:51 ` Yosry Ahmed
2024-01-18 0:49 ` Nhat Pham
2024-01-18 15:34 ` Johannes Weiner
2024-01-18 17:30 ` Yosry Ahmed
2024-01-18 18:06 ` Johannes Weiner
2024-01-18 18:37 ` Yosry Ahmed
2024-01-19 6:40 ` Chengming Zhou
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='CAF8kJuO=3-DMV-rXBZE-hVUXzQcV5B1HPFGzpzL99_5WggqF9Q@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=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