Skip to content

Commit a1593c9

Browse files
LuBaolugregkh
authored andcommitted
x86/mm: use pagetable_free()
commit bf9e4e3 upstream. The kernel's memory management subsystem provides a dedicated interface, pagetable_free(), for freeing page table pages. Updates two call sites to use pagetable_free() instead of the lower-level __free_page() or free_pages(). This improves code consistency and clarity, and ensures the correct freeing mechanism is used. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Lu Baolu <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Acked-by: David Hildenbrand <[email protected]> Acked-by: Mike Rapoport (Microsoft) <[email protected]> Cc: Alistair Popple <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Betkov <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jann Horn <[email protected]> Cc: Jean-Philippe Brucker <[email protected]> Cc: Joerg Roedel <[email protected]> Cc: Kevin Tian <[email protected]> Cc: Liam Howlett <[email protected]> Cc: Lorenzo Stoakes <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Robin Murohy <[email protected]> Cc: Thomas Gleinxer <[email protected]> Cc: "Uladzislau Rezki (Sony)" <[email protected]> Cc: Vasant Hegde <[email protected]> Cc: Vinicius Costa Gomes <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Will Deacon <[email protected]> Cc: Yi Lai <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c32806b commit a1593c9

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

arch/x86/mm/init_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ static void __meminit free_pagetable(struct page *page, int order)
10311031
free_reserved_pages(page, nr_pages);
10321032
#endif
10331033
} else {
1034-
__free_pages(page, order);
1034+
pagetable_free(page_ptdesc(page));
10351035
}
10361036
}
10371037

arch/x86/mm/pat/set_memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ static void cpa_collapse_large_pages(struct cpa_data *cpa)
429429

430430
list_for_each_entry_safe(ptdesc, tmp, &pgtables, pt_list) {
431431
list_del(&ptdesc->pt_list);
432-
__free_page(ptdesc_page(ptdesc));
432+
pagetable_free(ptdesc);
433433
}
434434
}
435435

0 commit comments

Comments
 (0)