Re: [PATCHv3 06/11] mm/vmscan: Use PG_dropbehind instead of PG_reclaim

From: Andrew Morton
Date: Mon Feb 03 2025 - 19:49:04 EST


On Mon, 3 Feb 2025 10:39:58 +0200 "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx> wrote:

> > diff --git a/mm/filemap.c b/mm/filemap.c
> > index 4fe551037bf7..98493443d120 100644
> > --- a/mm/filemap.c
> > +++ b/mm/filemap.c
> > @@ -1605,8 +1605,9 @@ static void folio_end_reclaim_write(struct folio *folio)
> > * invalidation in that case.
> > */
> > if (in_task() && folio_trylock(folio)) {
> > - if (folio->mapping)
> > - folio_unmap_invalidate(folio->mapping, folio, 0);
> > + struct address_space *mapping = folio_mapping(folio);
> > + if (mapping)
> > + folio_unmap_invalidate(mapping, folio, 0);
> > folio_unlock(folio);
> > }
> > }
>
> Once you do this, folio_unmap_invalidate() will never succeed for
> swapcache as folio->mapping != mapping check will always be true and it
> will fail with -EBUSY.
>
> I guess we need to do something similar to what __remove_mapping() does
> for swapcache folios.

Thanks, I'll drop the v3 series from mm.git.