Re: [PATCH v3 1/8] mm: Remove special swap entry functions

From: Alistair Popple
Date: Tue Mar 02 2021 - 07:35:39 EST


On Tuesday, 2 March 2021 7:52:53 PM AEDT Alistair Popple wrote:
> On Saturday, 27 February 2021 2:59:09 AM AEDT Christoph Hellwig wrote:
> > > - struct page *page = migration_entry_to_page(entry);
> > > + struct page *page = pfn_to_page(swp_offset(entry));
> >
> > I wonder if keeping a single special_entry_to_page() helper would still
> > me a useful. But I'm not entirely sure. There are also two more open
> > coded copies of this in the THP migration code.
>
> I think it might be if only to clearly document where these entries are
used.
> Will add it for the next version to see what it looks like.

Actually the main advantage ends up being that it becomes easy to retain the
page locked check for migration entries.

- Alistair