x86: merge zones_sizes_init for numa and non numa on 32-bit
move out e820_register_active_regions from non numa zones_sizes_init() and remove numa version zones_sizes_init(). and let 32 bit call remove_all_active_ranges() in setup_arch() directly like 64-bit Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
d9a81b4411
commit
cb95a13a8a
|
@ -749,10 +749,8 @@ void __init setup_arch(char **cmdline_p)
|
||||||
*/
|
*/
|
||||||
acpi_boot_table_init();
|
acpi_boot_table_init();
|
||||||
|
|
||||||
#ifdef CONFIG_X86_64
|
|
||||||
/* Remove active ranges so rediscovery with NUMA-awareness happens */
|
/* Remove active ranges so rediscovery with NUMA-awareness happens */
|
||||||
remove_all_active_ranges();
|
remove_all_active_ranges();
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_ACPI_NUMA
|
#ifdef CONFIG_ACPI_NUMA
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -327,7 +327,6 @@ void __init initmem_init(unsigned long start_pfn,
|
||||||
* and ZONE_HIGHMEM.
|
* and ZONE_HIGHMEM.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
remove_all_active_ranges();
|
|
||||||
get_memcfg_numa();
|
get_memcfg_numa();
|
||||||
|
|
||||||
kva_pages = round_up(calculate_numa_remap_pages(), PTRS_PER_PTE);
|
kva_pages = round_up(calculate_numa_remap_pages(), PTRS_PER_PTE);
|
||||||
|
@ -390,21 +389,6 @@ void __init initmem_init(unsigned long start_pfn,
|
||||||
setup_bootmem_allocator();
|
setup_bootmem_allocator();
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init zone_sizes_init(void)
|
|
||||||
{
|
|
||||||
unsigned long max_zone_pfns[MAX_NR_ZONES];
|
|
||||||
memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
|
|
||||||
max_zone_pfns[ZONE_DMA] =
|
|
||||||
virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
|
|
||||||
max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
|
|
||||||
#ifdef CONFIG_HIGHMEM
|
|
||||||
max_zone_pfns[ZONE_HIGHMEM] = highend_pfn;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
free_area_init_nodes(max_zone_pfns);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void __init set_highmem_pages_init(void)
|
void __init set_highmem_pages_init(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_HIGHMEM
|
#ifdef CONFIG_HIGHMEM
|
||||||
|
|
|
@ -660,12 +660,14 @@ void __init initmem_init(unsigned long start_pfn,
|
||||||
if (max_pfn > max_low_pfn)
|
if (max_pfn > max_low_pfn)
|
||||||
highstart_pfn = max_low_pfn;
|
highstart_pfn = max_low_pfn;
|
||||||
memory_present(0, 0, highend_pfn);
|
memory_present(0, 0, highend_pfn);
|
||||||
|
e820_register_active_regions(0, 0, highend_pfn);
|
||||||
printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
|
printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
|
||||||
pages_to_mb(highend_pfn - highstart_pfn));
|
pages_to_mb(highend_pfn - highstart_pfn));
|
||||||
num_physpages = highend_pfn;
|
num_physpages = highend_pfn;
|
||||||
high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;
|
high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;
|
||||||
#else
|
#else
|
||||||
memory_present(0, 0, max_low_pfn);
|
memory_present(0, 0, max_low_pfn);
|
||||||
|
e820_register_active_regions(0, 0, max_low_pfn);
|
||||||
num_physpages = max_low_pfn;
|
num_physpages = max_low_pfn;
|
||||||
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
|
high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
|
||||||
#endif
|
#endif
|
||||||
|
@ -677,25 +679,21 @@ void __init initmem_init(unsigned long start_pfn,
|
||||||
|
|
||||||
setup_bootmem_allocator();
|
setup_bootmem_allocator();
|
||||||
}
|
}
|
||||||
|
#endif /* !CONFIG_NEED_MULTIPLE_NODES */
|
||||||
|
|
||||||
void __init zone_sizes_init(void)
|
static void __init zone_sizes_init(void)
|
||||||
{
|
{
|
||||||
unsigned long max_zone_pfns[MAX_NR_ZONES];
|
unsigned long max_zone_pfns[MAX_NR_ZONES];
|
||||||
memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
|
memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
|
||||||
max_zone_pfns[ZONE_DMA] =
|
max_zone_pfns[ZONE_DMA] =
|
||||||
virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
|
virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
|
||||||
max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
|
max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
|
||||||
remove_all_active_ranges();
|
|
||||||
#ifdef CONFIG_HIGHMEM
|
#ifdef CONFIG_HIGHMEM
|
||||||
max_zone_pfns[ZONE_HIGHMEM] = highend_pfn;
|
max_zone_pfns[ZONE_HIGHMEM] = highend_pfn;
|
||||||
e820_register_active_regions(0, 0, highend_pfn);
|
|
||||||
#else
|
|
||||||
e820_register_active_regions(0, 0, max_low_pfn);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
free_area_init_nodes(max_zone_pfns);
|
free_area_init_nodes(max_zone_pfns);
|
||||||
}
|
}
|
||||||
#endif /* !CONFIG_NEED_MULTIPLE_NODES */
|
|
||||||
|
|
||||||
void __init setup_bootmem_allocator(void)
|
void __init setup_bootmem_allocator(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -96,7 +96,6 @@ extern void find_low_pfn_range(void);
|
||||||
extern unsigned long init_memory_mapping(unsigned long start,
|
extern unsigned long init_memory_mapping(unsigned long start,
|
||||||
unsigned long end);
|
unsigned long end);
|
||||||
extern void initmem_init(unsigned long, unsigned long);
|
extern void initmem_init(unsigned long, unsigned long);
|
||||||
extern void zone_sizes_init(void);
|
|
||||||
extern void setup_bootmem_allocator(void);
|
extern void setup_bootmem_allocator(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user