Skip to content

Commit

Permalink
replace-free-hugepage-folios-after-migration-fix
Browse files Browse the repository at this point in the history
fix comments, 80-column tweak

Cc: Baolin Wang <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Muchun Song <[email protected]>
Cc: yangge <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
akpm00 committed Dec 19, 2024
1 parent fba5261 commit cc47b89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
5 changes: 3 additions & 2 deletions mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2978,7 +2978,7 @@ int isolate_or_dissolve_huge_page(struct page *page, struct list_head *list)
/*
* replace_free_hugepage_folios - Replace free hugepage folios in a given pfn
* range with new folios.
* @stat_pfn: start pfn of the given pfn range
* @start_pfn: start pfn of the given pfn range
* @end_pfn: end pfn of the given pfn range
* Returns 0 on success, otherwise negated error.
*/
Expand All @@ -3000,7 +3000,8 @@ int replace_free_hugepage_folios(unsigned long start_pfn, unsigned long end_pfn)
}

if (!folio_ref_count(folio)) {
ret = alloc_and_dissolve_hugetlb_folio(h, folio, &isolate_list);
ret = alloc_and_dissolve_hugetlb_folio(h, folio,
&isolate_list);
if (ret)
break;

Expand Down
11 changes: 5 additions & 6 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6506,12 +6506,11 @@ int alloc_contig_range_noprof(unsigned long start, unsigned long end,
goto done;

/*
* When in-use hugetlb pages are migrated, they may simply be
* released back into the free hugepage pool instead of being
* returned to the buddy system. After the migration of in-use
* huge pages is completed, we will invoke the
* replace_free_hugepage_folios() function to ensure that
* these hugepages are properly released to the buddy system.
* When in-use hugetlb pages are migrated, they may simply be released
* back into the free hugepage pool instead of being returned to the
* buddy system. After the migration of in-use huge pages is completed,
* we will invoke replace_free_hugepage_folios() to ensure that these
* hugepages are properly released to the buddy system.
*/
ret = replace_free_hugepage_folios(start, end);
if (ret)
Expand Down

0 comments on commit cc47b89

Please sign in to comment.