diff options
author | Andy Whitcroft <apw@shadowen.org> | 2005-06-23 03:08:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-23 12:45:06 -0400 |
commit | 145e664231648121026d470094c200851a446a73 (patch) | |
tree | c9362f4ec3e3114afb9b7134ae89152cbbc73cd4 /arch | |
parent | 74b30be2e183bd9a12d0350698996e3d1969f290 (diff) |
[PATCH] ppc64: sparsemem memory model
Provide the architecture specific implementation for SPARSEMEM for PPC64
systems.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Mike Kravetz <kravetz@us.ibm.com> (in part)
Signed-off-by: Martin Bligh <mbligh@aracnet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ppc64/Kconfig | 13 | ||||
-rw-r--r-- | arch/ppc64/kernel/setup.c | 1 | ||||
-rw-r--r-- | arch/ppc64/mm/Makefile | 2 | ||||
-rw-r--r-- | arch/ppc64/mm/init.c | 18 |
4 files changed, 27 insertions, 7 deletions
diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig index c92d48fe06e5..6448231cb106 100644 --- a/arch/ppc64/Kconfig +++ b/arch/ppc64/Kconfig | |||
@@ -198,6 +198,13 @@ config HMT | |||
198 | This option enables hardware multithreading on RS64 cpus. | 198 | This option enables hardware multithreading on RS64 cpus. |
199 | pSeries systems p620 and p660 have such a cpu type. | 199 | pSeries systems p620 and p660 have such a cpu type. |
200 | 200 | ||
201 | config ARCH_SELECT_MEMORY_MODEL | ||
202 | def_bool y | ||
203 | |||
204 | config ARCH_FLATMEM_ENABLE | ||
205 | def_bool y | ||
206 | depends on !NUMA | ||
207 | |||
201 | config ARCH_DISCONTIGMEM_ENABLE | 208 | config ARCH_DISCONTIGMEM_ENABLE |
202 | def_bool y | 209 | def_bool y |
203 | depends on SMP && PPC_PSERIES | 210 | depends on SMP && PPC_PSERIES |
@@ -209,6 +216,10 @@ config ARCH_DISCONTIGMEM_DEFAULT | |||
209 | config ARCH_FLATMEM_ENABLE | 216 | config ARCH_FLATMEM_ENABLE |
210 | def_bool y | 217 | def_bool y |
211 | 218 | ||
219 | config ARCH_SPARSEMEM_ENABLE | ||
220 | def_bool y | ||
221 | depends on ARCH_DISCONTIGMEM_ENABLE | ||
222 | |||
212 | source "mm/Kconfig" | 223 | source "mm/Kconfig" |
213 | 224 | ||
214 | config HAVE_ARCH_EARLY_PFN_TO_NID | 225 | config HAVE_ARCH_EARLY_PFN_TO_NID |
@@ -229,7 +240,7 @@ config NODES_SPAN_OTHER_NODES | |||
229 | 240 | ||
230 | config NUMA | 241 | config NUMA |
231 | bool "NUMA support" | 242 | bool "NUMA support" |
232 | depends on DISCONTIGMEM | 243 | default y if DISCONTIGMEM || SPARSEMEM |
233 | 244 | ||
234 | config SCHED_SMT | 245 | config SCHED_SMT |
235 | bool "SMT (Hyperthreading) scheduler support" | 246 | bool "SMT (Hyperthreading) scheduler support" |
diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c index 8e439a817642..9e70ac90dec1 100644 --- a/arch/ppc64/kernel/setup.c +++ b/arch/ppc64/kernel/setup.c | |||
@@ -1055,6 +1055,7 @@ void __init setup_arch(char **cmdline_p) | |||
1055 | 1055 | ||
1056 | /* set up the bootmem stuff with available memory */ | 1056 | /* set up the bootmem stuff with available memory */ |
1057 | do_init_bootmem(); | 1057 | do_init_bootmem(); |
1058 | sparse_init(); | ||
1058 | 1059 | ||
1059 | /* initialize the syscall map in systemcfg */ | 1060 | /* initialize the syscall map in systemcfg */ |
1060 | setup_syscall_map(); | 1061 | setup_syscall_map(); |
diff --git a/arch/ppc64/mm/Makefile b/arch/ppc64/mm/Makefile index ac522d57b2a7..3695d00d347f 100644 --- a/arch/ppc64/mm/Makefile +++ b/arch/ppc64/mm/Makefile | |||
@@ -6,6 +6,6 @@ EXTRA_CFLAGS += -mno-minimal-toc | |||
6 | 6 | ||
7 | obj-y := fault.o init.o imalloc.o hash_utils.o hash_low.o tlb.o \ | 7 | obj-y := fault.o init.o imalloc.o hash_utils.o hash_low.o tlb.o \ |
8 | slb_low.o slb.o stab.o mmap.o | 8 | slb_low.o slb.o stab.o mmap.o |
9 | obj-$(CONFIG_DISCONTIGMEM) += numa.o | 9 | obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o |
10 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o | 10 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o |
11 | obj-$(CONFIG_PPC_MULTIPLATFORM) += hash_native.o | 11 | obj-$(CONFIG_PPC_MULTIPLATFORM) += hash_native.o |
diff --git a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c index 29dbe084c21f..b50b3a446dbe 100644 --- a/arch/ppc64/mm/init.c +++ b/arch/ppc64/mm/init.c | |||
@@ -531,7 +531,7 @@ EXPORT_SYMBOL(page_is_ram); | |||
531 | * Initialize the bootmem system and give it all the memory we | 531 | * Initialize the bootmem system and give it all the memory we |
532 | * have available. | 532 | * have available. |
533 | */ | 533 | */ |
534 | #ifndef CONFIG_DISCONTIGMEM | 534 | #ifndef CONFIG_NEED_MULTIPLE_NODES |
535 | void __init do_init_bootmem(void) | 535 | void __init do_init_bootmem(void) |
536 | { | 536 | { |
537 | unsigned long i; | 537 | unsigned long i; |
@@ -553,12 +553,20 @@ void __init do_init_bootmem(void) | |||
553 | 553 | ||
554 | max_pfn = max_low_pfn; | 554 | max_pfn = max_low_pfn; |
555 | 555 | ||
556 | /* add all physical memory to the bootmem map. Also find the first */ | 556 | /* Add all physical memory to the bootmem map, mark each area |
557 | * present. | ||
558 | */ | ||
557 | for (i=0; i < lmb.memory.cnt; i++) { | 559 | for (i=0; i < lmb.memory.cnt; i++) { |
558 | unsigned long physbase, size; | 560 | unsigned long physbase, size; |
561 | unsigned long start_pfn, end_pfn; | ||
559 | 562 | ||
560 | physbase = lmb.memory.region[i].physbase; | 563 | physbase = lmb.memory.region[i].physbase; |
561 | size = lmb.memory.region[i].size; | 564 | size = lmb.memory.region[i].size; |
565 | |||
566 | start_pfn = physbase >> PAGE_SHIFT; | ||
567 | end_pfn = start_pfn + (size >> PAGE_SHIFT); | ||
568 | memory_present(0, start_pfn, end_pfn); | ||
569 | |||
562 | free_bootmem(physbase, size); | 570 | free_bootmem(physbase, size); |
563 | } | 571 | } |
564 | 572 | ||
@@ -597,7 +605,7 @@ void __init paging_init(void) | |||
597 | free_area_init_node(0, NODE_DATA(0), zones_size, | 605 | free_area_init_node(0, NODE_DATA(0), zones_size, |
598 | __pa(PAGE_OFFSET) >> PAGE_SHIFT, zholes_size); | 606 | __pa(PAGE_OFFSET) >> PAGE_SHIFT, zholes_size); |
599 | } | 607 | } |
600 | #endif /* CONFIG_DISCONTIGMEM */ | 608 | #endif /* ! CONFIG_NEED_MULTIPLE_NODES */ |
601 | 609 | ||
602 | static struct kcore_list kcore_vmem; | 610 | static struct kcore_list kcore_vmem; |
603 | 611 | ||
@@ -628,7 +636,7 @@ module_init(setup_kcore); | |||
628 | 636 | ||
629 | void __init mem_init(void) | 637 | void __init mem_init(void) |
630 | { | 638 | { |
631 | #ifdef CONFIG_DISCONTIGMEM | 639 | #ifdef CONFIG_NEED_MULTIPLE_NODES |
632 | int nid; | 640 | int nid; |
633 | #endif | 641 | #endif |
634 | pg_data_t *pgdat; | 642 | pg_data_t *pgdat; |
@@ -639,7 +647,7 @@ void __init mem_init(void) | |||
639 | num_physpages = max_low_pfn; /* RAM is assumed contiguous */ | 647 | num_physpages = max_low_pfn; /* RAM is assumed contiguous */ |
640 | high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); | 648 | high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); |
641 | 649 | ||
642 | #ifdef CONFIG_DISCONTIGMEM | 650 | #ifdef CONFIG_NEED_MULTIPLE_NODES |
643 | for_each_online_node(nid) { | 651 | for_each_online_node(nid) { |
644 | if (NODE_DATA(nid)->node_spanned_pages != 0) { | 652 | if (NODE_DATA(nid)->node_spanned_pages != 0) { |
645 | printk("freeing bootmem node %x\n", nid); | 653 | printk("freeing bootmem node %x\n", nid); |