Commit 3616bd3a authored by Liu Shixin's avatar Liu Shixin
Browse files

mm/dynamic_pool: clear PG_hugetlb when demote hugepages

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


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 56379aed
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -269,6 +269,7 @@ static int dpool_demote_huge_page(struct pages_pool *src_pool,
	__ClearPageDpool(page);
	src_pool->free_pages--;

	__folio_clear_hugetlb(page_folio(page));
	clear_compound_page(page_folio(page), PMD_ORDER);
	for (i = 0; i < nr_pages; i++) {
		subpage = folio_page(folio, i);