Re: [PATCH v2 19/46] mm/migrate: Add folio_migrate_flags()

From: Christoph Hellwig
Date: Wed Jun 23 2021 - 04:32:39 EST


> /*
> * Please do not reorder this without considering how mm/ksm.c's
> * get_ksm_page() depends upon ksm_migrate_page() and PageSwapCache().
> */
> - if (PageSwapCache(page))
> - ClearPageSwapCache(page);
> - ClearPagePrivate(page);
> - set_page_private(page, 0);
> + if (folio_swapcache(folio))
> + folio_clear_swapcache_flag(folio);
> + folio_clear_private_flag(folio);
> +
> + /* page->private contains hugetlb specific flags */
> + if (!folio_hugetlb(folio))
> + folio->private = NULL;

Ymmm. Dosn't the ->private handling change now? Given that you
added a comment it seems intentional, but I do not understand why
it changes as part of the conversion.