mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
hugetlb: optimise hugetlb_folio_init_tail_vmemmap()
Extract the zone number directly from the folio instead of using the folio's zone number to look up the zone and asking the zone what its number is. Also we should use &folio->page instead of casting from folio to page Link: https://lkml.kernel.org/r/20251106201452.2292631-1-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Muchun Song <muchun.song@linux.dev> Cc: Oscar Salvador <osalvador@suse.de> Cc: David Hildenbrand <david@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
135e541ae8
commit
e24f66e87b
@@ -3246,7 +3246,7 @@ static void __init hugetlb_folio_init_tail_vmemmap(struct folio *folio,
|
||||
unsigned long start_page_number,
|
||||
unsigned long end_page_number)
|
||||
{
|
||||
enum zone_type zone = zone_idx(folio_zone(folio));
|
||||
enum zone_type zone = folio_zonenum(folio);
|
||||
int nid = folio_nid(folio);
|
||||
struct page *page = folio_page(folio, start_page_number);
|
||||
unsigned long head_pfn = folio_pfn(folio);
|
||||
@@ -3279,7 +3279,7 @@ static void __init hugetlb_folio_init_vmemmap(struct folio *folio,
|
||||
ret = folio_ref_freeze(folio, 1);
|
||||
VM_BUG_ON(!ret);
|
||||
hugetlb_folio_init_tail_vmemmap(folio, 1, nr_pages);
|
||||
prep_compound_head((struct page *)folio, huge_page_order(h));
|
||||
prep_compound_head(&folio->page, huge_page_order(h));
|
||||
}
|
||||
|
||||
static bool __init hugetlb_bootmem_page_prehvo(struct huge_bootmem_page *m)
|
||||
|
||||
Reference in New Issue
Block a user