[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJD7tkYO3fPz0n4HXCH6iXKfM_H29DAoH2wGT+mEm8hdtpw3vA@mail.gmail.com>
Date: Tue, 3 Sep 2024 12:41:06 -0700
From: Yosry Ahmed <yosryahmed@...gle.com>
To: Kairui Song <ryncsn@...il.com>
Cc: Barry Song <21cnbao@...il.com>, akpm@...ux-foundation.org, chengming.zhou@...ux.dev,
chrisl@...nel.org, hannes@...xchg.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, nphamcs@...il.com, ryan.roberts@....com,
syzbot+ce6029250d7fd4d0476d@...kaller.appspotmail.com,
syzkaller-bugs@...glegroups.com, ying.huang@...el.com
Subject: Re: [syzbot] [mm?] WARNING in zswap_swapoff
On Tue, Sep 3, 2024 at 11:51 AM Kairui Song <ryncsn@...il.com> wrote:
>
> On Wed, Sep 4, 2024 at 2:22 AM Yosry Ahmed <yosryahmed@...gle.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.
Powered by blists - more mailing lists