[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240805015324.45134-1-21cnbao@gmail.com>
Date: Mon, 5 Aug 2024 13:53:24 +1200
From: Barry Song <21cnbao@...il.com>
To: chrisl@...nel.org
Cc: akpm@...ux-foundation.org,
baohua@...nel.org,
hughd@...gle.com,
kaleshsingh@...gle.com,
linux-kernel@...r.kernel.org,
linux-mm@...ck.org,
ryan.roberts@....com,
ryncsn@...il.com,
ying.huang@...el.com
Subject: Re: [PATCH v5 6/9] mm: swap: allow cache reclaim to skip slot cache
On Mon, Aug 5, 2024 at 6:07 AM Chris Li <chrisl@...nel.org> wrote:
> > > > +
> > > > + spin_lock(&si->lock);
> > > > + /* Only sinple page folio can be backed by zswap */
> > > > + if (!nr_pages)
> > > > + zswap_invalidate(entry);
> > >
> > > I am trying to figure out if I am mad :-) Does nr_pages == 0 means single
> > > page folio?
> > >
> >
> > Hi Barry
> >
> > I'm sorry, this should be nr_pages == 1, I messed up order and nr, as
> > zswap only works for single page folios.
> Ack. Should be nr_pages == 1.
>
Yes. Andrew, can you please help squash the below fix,
small folios should have nr_pages == 1 but not nr_page == 0
diff --git a/mm/swapfile.c b/mm/swapfile.c
index ea023fc25d08..6de12d712c7e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -224,7 +224,7 @@ static int __try_to_reclaim_swap(struct swap_info_struct *si,
spin_lock(&si->lock);
/* Only sinple page folio can be backed by zswap */
- if (!nr_pages)
+ if (nr_pages == 1)
zswap_invalidate(entry);
swap_entry_range_free(si, entry, nr_pages);
spin_unlock(&si->lock);
> Barry, thanks for catching that.
>
> Chris
Thanks
Barry
Powered by blists - more mailing lists