Re: [PATCH 3/9] mm/hugetlb: convert putback_active_hugepage to take in a folio

From: Matthew Wilcox
Date: Fri Jan 20 2023 - 00:48:54 EST


On Thu, Jan 19, 2023 at 01:14:40PM -0800, Sidhartha Kumar wrote:
> -void putback_active_hugepage(struct page *page)
> +void putback_active_hugetlb_folio(struct folio *folio)

Maybe call this folio_putback_active_hugetlb()? It fits better
with folio_putback_lru().

> +++ b/mm/migrate.c
> @@ -151,7 +151,7 @@ void putback_movable_pages(struct list_head *l)
>
> list_for_each_entry_safe(page, page2, l, lru) {
> if (unlikely(PageHuge(page))) {
> - putback_active_hugepage(page);
> + putback_active_hugetlb_folio(page_folio(page));
> continue;
> }
> list_del(&page->lru);

Maybe we need a patch first to convert this loop from an iteration of
page->lru to folio->lru to avoid that call to page_folio()?