From: Matthew Wilcox <willy@infradead.org>
To: Yosry Ahmed <yosryahmed@google.com>
Cc: Kairui Song <ryncsn@gmail.com>,
linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Nhat Pham <nphamcs@gmail.com>,
Chengming Zhou <chengming.zhou@linux.dev>,
Chris Li <chrisl@kernel.org>, Barry Song <v-songbaohua@oppo.com>,
"Huang, Ying" <ying.huang@intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm, zswap: don't touch the XArray lock if there is no entry to free
Date: Fri, 18 Oct 2024 21:55:17 +0100 [thread overview]
Message-ID: <ZxLLNfbLifp-b3W7@casper.infradead.org> (raw)
In-Reply-To: <CAJD7tkZMTJKYR+au2rjP1v+c8PvdP4D39j86tHg=o2riKGYynQ@mail.gmail.com>
On Fri, Oct 18, 2024 at 01:40:18PM -0700, Yosry Ahmed wrote:
> Oh I thought xas_reload() is enough here to check that the entry is
> still there after the lock is acquired. Do we have to start the walk
> over after holding the lock?
Yes. The entry is guaranteed to still be valid, but the node you're
looking in might have been freed, so you can't modify the node without
making sure the node is still in the tree. We could make that cheaper
than a rewalk, but you're going to need to write that code since you're
the first to want to do something like this.
next prev parent reply other threads:[~2024-10-18 20:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 19:25 Kairui Song
2024-10-18 19:46 ` Matthew Wilcox
2024-10-18 20:01 ` Kairui Song
2024-10-18 20:40 ` Yosry Ahmed
2024-10-18 20:55 ` Matthew Wilcox [this message]
2024-10-18 21:00 ` Yosry Ahmed
2024-10-18 21:38 ` Matthew Wilcox
2024-10-18 22:28 ` Yosry Ahmed
2024-10-18 22:38 ` Johannes Weiner
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=ZxLLNfbLifp-b3W7@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--cc=chrisl@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--cc=ryncsn@gmail.com \
--cc=v-songbaohua@oppo.com \
--cc=ying.huang@intel.com \
--cc=yosryahmed@google.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