diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2009-05-07 08:35:41 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-11 05:52:06 -0400 |
commit | 3551f88f6439cf4da3f5a3747b320280e30500de (patch) | |
tree | 5340ec7013bee0b73e288dcde5a6eee9fe2612a1 /arch/x86 | |
parent | 0964b0562bb9c93194e852b47bab2397b9e11c18 (diff) |
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>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/mm/init_64.c | 6 | ||||
-rw-r--r-- | arch/x86/mm/numa_64.c | 15 |
2 files changed, 5 insertions, 16 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 6a1a573e20f..be7e1279178 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -585,6 +585,7 @@ void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn) | |||
585 | early_res_to_bootmem(0, end_pfn<<PAGE_SHIFT); | 585 | early_res_to_bootmem(0, end_pfn<<PAGE_SHIFT); |
586 | reserve_bootmem(bootmap, bootmap_size, BOOTMEM_DEFAULT); | 586 | reserve_bootmem(bootmap, bootmap_size, BOOTMEM_DEFAULT); |
587 | } | 587 | } |
588 | #endif | ||
588 | 589 | ||
589 | void __init paging_init(void) | 590 | void __init paging_init(void) |
590 | { | 591 | { |
@@ -595,11 +596,14 @@ void __init paging_init(void) | |||
595 | max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN; | 596 | max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN; |
596 | max_zone_pfns[ZONE_NORMAL] = max_pfn; | 597 | max_zone_pfns[ZONE_NORMAL] = max_pfn; |
597 | 598 | ||
599 | #ifdef CONFIG_NUMA | ||
600 | sparse_memory_present_with_active_regions(MAX_NUMNODES); | ||
601 | #else | ||
598 | memory_present(0, 0, max_pfn); | 602 | memory_present(0, 0, max_pfn); |
603 | #endif | ||
599 | sparse_init(); | 604 | sparse_init(); |
600 | free_area_init_nodes(max_zone_pfns); | 605 | free_area_init_nodes(max_zone_pfns); |
601 | } | 606 | } |
602 | #endif | ||
603 | 607 | ||
604 | /* | 608 | /* |
605 | * Memory hotplug specific functions | 609 | * Memory hotplug specific functions |
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index 2d05a12029d..fb61d81a656 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -578,21 +578,6 @@ unsigned long __init numa_free_all_bootmem(void) | |||
578 | return pages; | 578 | return pages; |
579 | } | 579 | } |
580 | 580 | ||
581 | void __init paging_init(void) | ||
582 | { | ||
583 | unsigned long max_zone_pfns[MAX_NR_ZONES]; | ||
584 | |||
585 | memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); | ||
586 | max_zone_pfns[ZONE_DMA] = MAX_DMA_PFN; | ||
587 | max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN; | ||
588 | max_zone_pfns[ZONE_NORMAL] = max_pfn; | ||
589 | |||
590 | sparse_memory_present_with_active_regions(MAX_NUMNODES); | ||
591 | sparse_init(); | ||
592 | |||
593 | free_area_init_nodes(max_zone_pfns); | ||
594 | } | ||
595 | |||
596 | static __init int numa_setup(char *opt) | 581 | static __init int numa_setup(char *opt) |
597 | { | 582 | { |
598 | if (!opt) | 583 | if (!opt) |