Skip to contentSkip to conversation

Hugetlb gigantic page and dynamic allocation

DISCUSSION Huang Shijie 1 participant 1 message Nov 16, 2016 1 message not in the archive Memory management

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 15 lines · Aneesh Kumar K.V

Hi,

I was looking at this w.r.t a recent patch series and wondering whether the usage of alloc_contig_page is correct there. We do

static int __alloc_gigantic_page(unsigned long start_pfn,
unsigned long nr_pages)

{
	unsigned long end_pfn = start_pfn + nr_pages;
	return alloc_contig_range(start_pfn, end_pfn, MIGRATE_MOVABLE);
}
Quoted 5 lines

That implies, if we fail in certain case we will mark the page block migrate type MIGRATE_MOVABLE . Do we want to do that in all case ? What if the start_pfn was convering a page block of MIGRATE_CMA type ? Should we skip pageblock with MIGRATE_CMA type when trying to allocate gigantic huge page ?

I have not read the code so deep. I will study it when I have time.

Btw: Do we really need the free_contig_range() run like this? free page one by one? I guess we can optimize it to free pages at the unit of the page order.

Thanks
Huang Shijie

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>