Commit 501f48c2 authored by Liu Shixin's avatar Liu Shixin
Browse files

mm/dynamic_pool: clear PG_hugetlb when promote hugepages

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9TL9N


CVE: NA

--------------------------------

Before commit 738fe30d, the PG_hugetlb is recorded in page->flags,
and will be cleared by clear_compound_page(). Now since PG_hugetlb turned
to record into page_type, we have to clear it by __folio_clear_hugetlb().

Fixes: 738fe30d ("mm: turn folio_test_hugetlb into a PageType")
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
parent c0b6b443
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -353,6 +353,7 @@ static int dpool_promote_gigantic_page(struct pages_pool *src_pool,

	for (i = 0; i < nr_pages; i += block_size) {
		subpage = pfn_to_page(spage->start_pfn + i);
		__folio_clear_hugetlb(page_folio(subpage));
		clear_compound_page(page_folio(subpage), PMD_ORDER);
		__ClearPageDpool(subpage);
		list_del(&subpage->lru);