summaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorSidhartha Kumar <sidhartha.kumar@oracle.com>2022-12-12 23:55:29 +0100
committerAndrew Morton <akpm@linux-foundation.org>2022-12-13 01:47:11 +0100
commitc45bc55a99957b20e4e0333bcd42e12d1833a7f5 (patch)
tree351f020a04282256fcacfa458d36c3efc205a59e /mm/hugetlb.c
parentmm: mmu_gather: allow more than one batch of delayed rmaps (diff)
downloadlinux-c45bc55a99957b20e4e0333bcd42e12d1833a7f5.tar.xz
linux-c45bc55a99957b20e4e0333bcd42e12d1833a7f5.zip
mm/hugetlb: set head flag before setting compound_order in __prep_compound_gigantic_folio
folio_set_compound_order() checks if the passed in folio is a large folio. A large folio is indicated by the PG_head flag. Call __folio_set_head() before setting the order. Link: https://lkml.kernel.org/r/20221212225529.22493-1-sidhartha.kumar@oracle.com Fixes: d1c6095572d0 ("mm/hugetlb: convert hugetlb prep functions to folios") Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com> Reported-by: David Hildenbrand <david@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r--mm/hugetlb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 8c6fe2286814..7cdbcc22587b 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1805,10 +1805,10 @@ static bool __prep_compound_gigantic_folio(struct folio *folio,
int nr_pages = 1 << order;
struct page *p;
- /* we rely on prep_new_hugetlb_folio to set the destructor */
- folio_set_compound_order(folio, order);
__folio_clear_reserved(folio);
__folio_set_head(folio);
+ /* we rely on prep_new_hugetlb_folio to set the destructor */
+ folio_set_compound_order(folio, order);
for (i = 0; i < nr_pages; i++) {
p = folio_page(folio, i);