Re: [PATCH v5 6/9] mm: swap: allow cache reclaim to skip slot cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 5, 2024 at 6:07 AM Chris Li <chrisl@xxxxxxxxxx> 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





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux