@@ -2377,8 +2377,8 @@ static struct folio *remove_pool_hugetlb_folio(struct hstate *h,
23772377}
23782378
23792379/*
2380- * Dissolve a given free hugepage into free buddy pages. This function does
2381- * nothing for in-use hugepages and non-hugepages .
2380+ * Dissolve a given free hugetlb folio into free buddy pages. This function
2381+ * does nothing for in-use hugetlb folios and non-hugetlb folios .
23822382 * This function returns values like below:
23832383 *
23842384 * -ENOMEM: failed to allocate vmemmap pages to free the freed hugepages
@@ -2390,10 +2390,9 @@ static struct folio *remove_pool_hugetlb_folio(struct hstate *h,
23902390 * 0: successfully dissolved free hugepages or the page is not a
23912391 * hugepage (considered as already dissolved)
23922392 */
2393- int dissolve_free_huge_page (struct page * page )
2393+ int dissolve_free_hugetlb_folio (struct folio * folio )
23942394{
23952395 int rc = - EBUSY ;
2396- struct folio * folio = page_folio (page );
23972396
23982397retry :
23992398 /* Not to disrupt normal path by vainly holding hugetlb_lock */
@@ -2470,13 +2469,13 @@ int dissolve_free_huge_page(struct page *page)
24702469 * make specified memory blocks removable from the system.
24712470 * Note that this will dissolve a free gigantic hugepage completely, if any
24722471 * part of it lies within the given range.
2473- * Also note that if dissolve_free_huge_page () returns with an error, all
2474- * free hugepages that were dissolved before that error are lost.
2472+ * Also note that if dissolve_free_hugetlb_folio () returns with an error, all
2473+ * free hugetlb folios that were dissolved before that error are lost.
24752474 */
24762475int dissolve_free_huge_pages (unsigned long start_pfn , unsigned long end_pfn )
24772476{
24782477 unsigned long pfn ;
2479- struct page * page ;
2478+ struct folio * folio ;
24802479 int rc = 0 ;
24812480 unsigned int order ;
24822481 struct hstate * h ;
@@ -2489,8 +2488,8 @@ int dissolve_free_huge_pages(unsigned long start_pfn, unsigned long end_pfn)
24892488 order = min (order , huge_page_order (h ));
24902489
24912490 for (pfn = start_pfn ; pfn < end_pfn ; pfn += 1 << order ) {
2492- page = pfn_to_page (pfn );
2493- rc = dissolve_free_huge_page ( page );
2491+ folio = pfn_folio (pfn );
2492+ rc = dissolve_free_hugetlb_folio ( folio );
24942493 if (rc )
24952494 break ;
24962495 }
0 commit comments