diff options
author | Matt Tolentino <metolent@snoqualmie.dp.intel.com> | 2005-06-23 03:08:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-23 12:45:06 -0400 |
commit | 2b97690f4cd960779fb351b7cd9974390afabb36 (patch) | |
tree | 26a94d00bc67f3036cea966ba7435f8e1efd3779 /arch/x86_64 | |
parent | 1035faf1b19efb83d5626985240f52cd149dd39b (diff) |
[PATCH] reorganize x86-64 NUMA and DISCONTIGMEM config options
In order to use the alternative sparsemem implmentation for NUMA kernels,
we need to reorganize the config options. This patch effectively abstracts
out the CONFIG_DISCONTIGMEM options to CONFIG_NUMA in most cases. Thus,
the discontigmem implementation may be employed as always, but the
sparsemem implementation may be used alternatively.
Signed-off-by: Matt Tolentino <matthew.e.tolentino@intel.com>
Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/kernel/head64.c | 2 | ||||
-rw-r--r-- | arch/x86_64/kernel/setup.c | 6 | ||||
-rw-r--r-- | arch/x86_64/mm/Makefile | 2 | ||||
-rw-r--r-- | arch/x86_64/mm/init.c | 9 | ||||
-rw-r--r-- | arch/x86_64/mm/ioremap.c | 2 |
5 files changed, 12 insertions, 9 deletions
diff --git a/arch/x86_64/kernel/head64.c b/arch/x86_64/kernel/head64.c index 0f8c78dcd38c..cf6ab147a2a5 100644 --- a/arch/x86_64/kernel/head64.c +++ b/arch/x86_64/kernel/head64.c | |||
@@ -94,7 +94,7 @@ void __init x86_64_start_kernel(char * real_mode_data) | |||
94 | s = strstr(saved_command_line, "earlyprintk="); | 94 | s = strstr(saved_command_line, "earlyprintk="); |
95 | if (s != NULL) | 95 | if (s != NULL) |
96 | setup_early_printk(s); | 96 | setup_early_printk(s); |
97 | #ifdef CONFIG_DISCONTIGMEM | 97 | #ifdef CONFIG_NUMA |
98 | s = strstr(saved_command_line, "numa="); | 98 | s = strstr(saved_command_line, "numa="); |
99 | if (s != NULL) | 99 | if (s != NULL) |
100 | numa_setup(s+5); | 100 | numa_setup(s+5); |
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index 125a0bb1f5d6..dd8419b37a7e 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
@@ -348,7 +348,7 @@ static __init void parse_cmdline_early (char ** cmdline_p) | |||
348 | if (!memcmp(from, "mem=", 4)) | 348 | if (!memcmp(from, "mem=", 4)) |
349 | parse_memopt(from+4, &from); | 349 | parse_memopt(from+4, &from); |
350 | 350 | ||
351 | #ifdef CONFIG_DISCONTIGMEM | 351 | #ifdef CONFIG_NUMA |
352 | if (!memcmp(from, "numa=", 5)) | 352 | if (!memcmp(from, "numa=", 5)) |
353 | numa_setup(from+5); | 353 | numa_setup(from+5); |
354 | #endif | 354 | #endif |
@@ -377,7 +377,7 @@ static __init void parse_cmdline_early (char ** cmdline_p) | |||
377 | *cmdline_p = command_line; | 377 | *cmdline_p = command_line; |
378 | } | 378 | } |
379 | 379 | ||
380 | #ifndef CONFIG_DISCONTIGMEM | 380 | #ifndef CONFIG_NUMA |
381 | static void __init contig_initmem_init(void) | 381 | static void __init contig_initmem_init(void) |
382 | { | 382 | { |
383 | unsigned long bootmap_size, bootmap; | 383 | unsigned long bootmap_size, bootmap; |
@@ -554,7 +554,7 @@ void __init setup_arch(char **cmdline_p) | |||
554 | acpi_numa_init(); | 554 | acpi_numa_init(); |
555 | #endif | 555 | #endif |
556 | 556 | ||
557 | #ifdef CONFIG_DISCONTIGMEM | 557 | #ifdef CONFIG_NUMA |
558 | numa_initmem_init(0, end_pfn); | 558 | numa_initmem_init(0, end_pfn); |
559 | #else | 559 | #else |
560 | contig_initmem_init(); | 560 | contig_initmem_init(); |
diff --git a/arch/x86_64/mm/Makefile b/arch/x86_64/mm/Makefile index 66c354ad80ca..1d232a87f113 100644 --- a/arch/x86_64/mm/Makefile +++ b/arch/x86_64/mm/Makefile | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | obj-y := init.o fault.o ioremap.o extable.o pageattr.o | 5 | obj-y := init.o fault.o ioremap.o extable.o pageattr.o |
6 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o | 6 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o |
7 | obj-$(CONFIG_DISCONTIGMEM) += numa.o | 7 | obj-$(CONFIG_NUMA) += numa.o |
8 | obj-$(CONFIG_K8_NUMA) += k8topology.o | 8 | obj-$(CONFIG_K8_NUMA) += k8topology.o |
9 | obj-$(CONFIG_ACPI_NUMA) += srat.o | 9 | obj-$(CONFIG_ACPI_NUMA) += srat.o |
10 | 10 | ||
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c index dbe53b4c7e66..72e4b364ed73 100644 --- a/arch/x86_64/mm/init.c +++ b/arch/x86_64/mm/init.c | |||
@@ -318,7 +318,7 @@ void zap_low_mappings(void) | |||
318 | flush_tlb_all(); | 318 | flush_tlb_all(); |
319 | } | 319 | } |
320 | 320 | ||
321 | #ifndef CONFIG_DISCONTIGMEM | 321 | #ifndef CONFIG_NUMA |
322 | void __init paging_init(void) | 322 | void __init paging_init(void) |
323 | { | 323 | { |
324 | { | 324 | { |
@@ -427,13 +427,16 @@ void __init mem_init(void) | |||
427 | reservedpages = 0; | 427 | reservedpages = 0; |
428 | 428 | ||
429 | /* this will put all low memory onto the freelists */ | 429 | /* this will put all low memory onto the freelists */ |
430 | #ifdef CONFIG_DISCONTIGMEM | 430 | #ifdef CONFIG_NUMA |
431 | totalram_pages += numa_free_all_bootmem(); | 431 | totalram_pages += numa_free_all_bootmem(); |
432 | tmp = 0; | 432 | tmp = 0; |
433 | /* should count reserved pages here for all nodes */ | 433 | /* should count reserved pages here for all nodes */ |
434 | #else | 434 | #else |
435 | |||
436 | #ifdef CONFIG_FLATMEM | ||
435 | max_mapnr = end_pfn; | 437 | max_mapnr = end_pfn; |
436 | if (!mem_map) BUG(); | 438 | if (!mem_map) BUG(); |
439 | #endif | ||
437 | 440 | ||
438 | totalram_pages += free_all_bootmem(); | 441 | totalram_pages += free_all_bootmem(); |
439 | 442 | ||
@@ -515,7 +518,7 @@ void free_initrd_mem(unsigned long start, unsigned long end) | |||
515 | void __init reserve_bootmem_generic(unsigned long phys, unsigned len) | 518 | void __init reserve_bootmem_generic(unsigned long phys, unsigned len) |
516 | { | 519 | { |
517 | /* Should check here against the e820 map to avoid double free */ | 520 | /* Should check here against the e820 map to avoid double free */ |
518 | #ifdef CONFIG_DISCONTIGMEM | 521 | #ifdef CONFIG_NUMA |
519 | int nid = phys_to_nid(phys); | 522 | int nid = phys_to_nid(phys); |
520 | reserve_bootmem_node(NODE_DATA(nid), phys, len); | 523 | reserve_bootmem_node(NODE_DATA(nid), phys, len); |
521 | #else | 524 | #else |
diff --git a/arch/x86_64/mm/ioremap.c b/arch/x86_64/mm/ioremap.c index 58aac23760ef..6972df480d2b 100644 --- a/arch/x86_64/mm/ioremap.c +++ b/arch/x86_64/mm/ioremap.c | |||
@@ -178,7 +178,7 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l | |||
178 | if (phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS) | 178 | if (phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS) |
179 | return (__force void __iomem *)phys_to_virt(phys_addr); | 179 | return (__force void __iomem *)phys_to_virt(phys_addr); |
180 | 180 | ||
181 | #ifndef CONFIG_DISCONTIGMEM | 181 | #ifdef CONFIG_FLATMEM |
182 | /* | 182 | /* |
183 | * Don't allow anybody to remap normal RAM that we're using.. | 183 | * Don't allow anybody to remap normal RAM that we're using.. |
184 | */ | 184 | */ |