x86: unify 64-bit UMA and NUMA paging_init()
64-bit UMA and NUMA versions of paging_init() are almost identical. Therefore, merge the copy in mm/numa_64.c to mm/init_64.c to remove duplicate code. [ Impact: cleanup ] Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> LKML-Reference: <1241699741.17846.30.camel@penberg-laptop> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
committed by
Ingo Molnar
parent
0964b0562b
commit
3551f88f64
@@ -585,6 +585,7 @@ void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn)
|
|||||||
early_res_to_bootmem(0, end_pfn<<PAGE_SHIFT);
|
early_res_to_bootmem(0, end_pfn<<PAGE_SHIFT);
|
||||||
reserve_bootmem(bootmap, bootmap_size, BOOTMEM_DEFAULT);
|
reserve_bootmem(bootmap, bootmap_size, BOOTMEM_DEFAULT);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void __init paging_init(void)
|
void __init paging_init(void)
|
||||||
{
|
{
|
||||||
@@ -595,11 +596,14 @@ void __init paging_init(void)
|
|||||||
max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN;
|
max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN;
|
||||||
max_zone_pfns[ZONE_NORMAL] = max_pfn;
|
max_zone_pfns[ZONE_NORMAL] = max_pfn;
|
||||||
|
|
||||||
|
#ifdef CONFIG_NUMA
|
||||||
|
sparse_memory_present_with_active_regions(MAX_NUMNODES);
|
||||||
|
#else
|
||||||
memory_present(0, 0, max_pfn);
|
memory_present(0, 0, max_pfn);
|
||||||
|
#endif
|
||||||
sparse_init();
|
sparse_init();
|
||||||
free_area_init_nodes(max_zone_pfns);
|
free_area_init_nodes(max_zone_pfns);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Memory hotplug specific functions
|
* Memory hotplug specific functions
|
||||||
|
@@ -578,21 +578,6 @@ unsigned long __init numa_free_all_bootmem(void)
|
|||||||
return pages;
|
return pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init paging_init(void)
|
|
||||||
{
|
|
||||||
unsigned long max_zone_pfns[MAX_NR_ZONES];
|
|
||||||
|
|
||||||
memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
|
|
||||||
max_zone_pfns[ZONE_DMA] = MAX_DMA_PFN;
|
|
||||||
max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN;
|
|
||||||
max_zone_pfns[ZONE_NORMAL] = max_pfn;
|
|
||||||
|
|
||||||
sparse_memory_present_with_active_regions(MAX_NUMNODES);
|
|
||||||
sparse_init();
|
|
||||||
|
|
||||||
free_area_init_nodes(max_zone_pfns);
|
|
||||||
}
|
|
||||||
|
|
||||||
static __init int numa_setup(char *opt)
|
static __init int numa_setup(char *opt)
|
||||||
{
|
{
|
||||||
if (!opt)
|
if (!opt)
|
||||||
|
Reference in New Issue
Block a user