From: Yosry Ahmed <yosryahmed@google.com>
To: Kairui Song <ryncsn@gmail.com>
Cc: Barry Song <21cnbao@gmail.com>,
akpm@linux-foundation.org, chengming.zhou@linux.dev,
chrisl@kernel.org, hannes@cmpxchg.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
nphamcs@gmail.com, ryan.roberts@arm.com,
syzbot+ce6029250d7fd4d0476d@syzkaller.appspotmail.com,
syzkaller-bugs@googlegroups.com, ying.huang@intel.com
Subject: Re: [syzbot] [mm?] WARNING in zswap_swapoff
Date: Tue, 3 Sep 2024 12:41:06 -0700 [thread overview]
Message-ID: <CAJD7tkYO3fPz0n4HXCH6iXKfM_H29DAoH2wGT+mEm8hdtpw3vA@mail.gmail.com> (raw)
In-Reply-To: <CAMgjq7ACohT_uerSz8E_994ZZCv709Zor+43hdmesW_59W1BWw@mail.gmail.com>
On Tue, Sep 3, 2024 at 11:51 AM Kairui Song <ryncsn@gmail.com> wrote:
>
> On Wed, Sep 4, 2024 at 2:22 AM Yosry Ahmed <yosryahmed@google.com> wrote:
> >
>
> Hi Yosry,
>
> > > > > diff --git a/mm/swapfile.c b/mm/swapfile.c
> > > > > index c1638a009113..8ff58be40544 100644
> > > > > --- a/mm/swapfile.c
> > > > > +++ b/mm/swapfile.c
> > > > > @@ -1514,6 +1514,8 @@ static bool __swap_entries_free(struct swap_info_struct *si,
> > > > > unlock_cluster_or_swap_info(si, ci);
> > > > >
> > > > > if (!has_cache) {
> > > > > + for (i = 0; i < nr; i++)
> > > > > + zswap_invalidate(swp_entry(si->type, offset + i));
> > > > > spin_lock(&si->lock);
> > > > > swap_entry_range_free(si, entry, nr);
> > > > > spin_unlock(&si->lock);
> > > > >
>
> This fix from Barry have been applied for mm-unstable and it's looking
> good so far.
Are we sure it fixes the problem? Unfortunately we don't have a
reproducer. The swap entry freeing paths are getting too tangled to
know for sure if zswap_invalidate() is being called in all cases,
which is why I prefer having a centralized callback for all swap entry
freeing hooks.
>
> > Kairui, Barry, any thoughts on this? Any preferences on how to make
> > sure zswap_invalidate() is being called in all possible swap freeing
> > paths?
>
> I have a set of patched that removed the si->lock around
> swap_entry_range_free, and the slot return cache is removed too. So we
> can move zswap_invalidate into it as locking or caching is no longer
> an issue, I will post it ASAP.
That sounds good, but I am not sure I understand what you mean by
removing the slot return cache. I will wait to see the patches.
next prev parent reply other threads:[~2024-09-03 19:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-16 19:52 [syzbot] [mm?] WARNING in zswap_swapoff syzbot
2024-08-19 20:12 ` Yosry Ahmed
2024-08-20 8:47 ` Kairui Song
2024-08-20 9:02 ` Kairui Song
2024-08-21 5:49 ` Barry Song
2024-08-21 6:42 ` Kairui Song
2024-08-21 7:38 ` Barry Song
2024-08-21 17:33 ` Kairui Song
2024-08-21 20:59 ` Barry Song
2024-08-22 18:12 ` Yosry Ahmed
2024-08-22 20:16 ` Chris Li
2024-08-22 20:20 ` Yosry Ahmed
2024-08-22 21:44 ` Chris Li
2024-09-03 18:21 ` Yosry Ahmed
2024-09-03 18:50 ` Kairui Song
2024-09-03 19:41 ` Yosry Ahmed [this message]
2024-08-20 9:22 ` Barry Song
2024-08-20 9:29 ` Kairui Song
2024-08-20 9:53 ` Barry Song
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=CAJD7tkYO3fPz0n4HXCH6iXKfM_H29DAoH2wGT+mEm8hdtpw3vA@mail.gmail.com \
--to=yosryahmed@google.com \
--cc=21cnbao@gmail.com \
--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=ryan.roberts@arm.com \
--cc=ryncsn@gmail.com \
--cc=syzbot+ce6029250d7fd4d0476d@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=ying.huang@intel.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;
as well as URLs for NNTP newsgroup(s).