aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/kernel/head64.c2
-rw-r--r--arch/x86_64/kernel/setup.c6
-rw-r--r--arch/x86_64/mm/Makefile2
-rw-r--r--arch/x86_64/mm/init.c9
-rw-r--r--arch/x86_64/mm/ioremap.c2
-rw-r--r--include/asm-x86_64/io.h5
-rw-r--r--include/asm-x86_64/mmzone.h15
-rw-r--r--include/asm-x86_64/page.h4
-rw-r--r--include/asm-x86_64/topology.h4
9 files changed, 25 insertions, 24 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
381static void __init contig_initmem_init(void) 381static 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
5obj-y := init.o fault.o ioremap.o extable.o pageattr.o 5obj-y := init.o fault.o ioremap.o extable.o pageattr.o
6obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o 6obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
7obj-$(CONFIG_DISCONTIGMEM) += numa.o 7obj-$(CONFIG_NUMA) += numa.o
8obj-$(CONFIG_K8_NUMA) += k8topology.o 8obj-$(CONFIG_K8_NUMA) += k8topology.o
9obj-$(CONFIG_ACPI_NUMA) += srat.o 9obj-$(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
322void __init paging_init(void) 322void __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)
515void __init reserve_bootmem_generic(unsigned long phys, unsigned len) 518void __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 */
diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h
index 94202703fae2..37fc3f149a5a 100644
--- a/include/asm-x86_64/io.h
+++ b/include/asm-x86_64/io.h
@@ -124,12 +124,7 @@ extern inline void * phys_to_virt(unsigned long address)
124/* 124/*
125 * Change "struct page" to physical address. 125 * Change "struct page" to physical address.
126 */ 126 */
127#ifdef CONFIG_DISCONTIGMEM
128#include <asm/mmzone.h>
129#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) 127#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
130#else
131#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
132#endif
133 128
134#include <asm-generic/iomap.h> 129#include <asm-generic/iomap.h>
135 130
diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h
index ca4fc3fe0dee..768413751b34 100644
--- a/include/asm-x86_64/mmzone.h
+++ b/include/asm-x86_64/mmzone.h
@@ -6,7 +6,7 @@
6 6
7#include <linux/config.h> 7#include <linux/config.h>
8 8
9#ifdef CONFIG_DISCONTIGMEM 9#ifdef CONFIG_NUMA
10 10
11#define VIRTUAL_BUG_ON(x) 11#define VIRTUAL_BUG_ON(x)
12 12
@@ -30,17 +30,16 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr)
30 return nid; 30 return nid;
31} 31}
32 32
33#define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT)
34
35#define kvaddr_to_nid(kaddr) phys_to_nid(__pa(kaddr))
36#define NODE_DATA(nid) (node_data[nid]) 33#define NODE_DATA(nid) (node_data[nid])
37 34
38#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) 35#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
39#define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ 36#define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \
40 NODE_DATA(nid)->node_spanned_pages) 37 NODE_DATA(nid)->node_spanned_pages)
41 38
42#define local_mapnr(kvaddr) \ 39#ifdef CONFIG_DISCONTIGMEM
43 ( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)) ) 40
41#define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT)
42#define kvaddr_to_nid(kaddr) phys_to_nid(__pa(kaddr))
44 43
45/* AK: this currently doesn't deal with invalid addresses. We'll see 44/* AK: this currently doesn't deal with invalid addresses. We'll see
46 if the 2.5 kernel doesn't pass them 45 if the 2.5 kernel doesn't pass them
@@ -57,4 +56,8 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr)
57 ({ u8 nid__ = pfn_to_nid(pfn); \ 56 ({ u8 nid__ = pfn_to_nid(pfn); \
58 nid__ != 0xff && (pfn) >= node_start_pfn(nid__) && (pfn) <= node_end_pfn(nid__); })) 57 nid__ != 0xff && (pfn) >= node_start_pfn(nid__) && (pfn) <= node_end_pfn(nid__); }))
59#endif 58#endif
59
60#define local_mapnr(kvaddr) \
61 ( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)) )
62#endif
60#endif 63#endif
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h
index 9ce338c3a71e..60130f4ca986 100644
--- a/include/asm-x86_64/page.h
+++ b/include/asm-x86_64/page.h
@@ -119,7 +119,9 @@ extern __inline__ int get_order(unsigned long size)
119 __pa(v); }) 119 __pa(v); })
120 120
121#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) 121#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
122#ifndef CONFIG_DISCONTIGMEM 122#define __boot_va(x) __va(x)
123#define __boot_pa(x) __pa(x)
124#ifdef CONFIG_FLATMEM
123#define pfn_to_page(pfn) (mem_map + (pfn)) 125#define pfn_to_page(pfn) (mem_map + (pfn))
124#define page_to_pfn(page) ((unsigned long)((page) - mem_map)) 126#define page_to_pfn(page) ((unsigned long)((page) - mem_map))
125#define pfn_valid(pfn) ((pfn) < max_mapnr) 127#define pfn_valid(pfn) ((pfn) < max_mapnr)
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h
index 67f24e0ea819..da21573ec731 100644
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/config.h> 4#include <linux/config.h>
5 5
6#ifdef CONFIG_DISCONTIGMEM 6#ifdef CONFIG_NUMA
7 7
8#include <asm/mpspec.h> 8#include <asm/mpspec.h>
9#include <asm/bitops.h> 9#include <asm/bitops.h>
@@ -37,7 +37,6 @@ static inline cpumask_t __pcibus_to_cpumask(int bus)
37} 37}
38#define pcibus_to_cpumask(bus) __pcibus_to_cpumask(bus->number) 38#define pcibus_to_cpumask(bus) __pcibus_to_cpumask(bus->number)
39 39
40#ifdef CONFIG_NUMA
41/* sched_domains SD_NODE_INIT for x86_64 machines */ 40/* sched_domains SD_NODE_INIT for x86_64 machines */
42#define SD_NODE_INIT (struct sched_domain) { \ 41#define SD_NODE_INIT (struct sched_domain) { \
43 .span = CPU_MASK_NONE, \ 42 .span = CPU_MASK_NONE, \
@@ -59,7 +58,6 @@ static inline cpumask_t __pcibus_to_cpumask(int bus)
59 .balance_interval = 1, \ 58 .balance_interval = 1, \
60 .nr_balance_failed = 0, \ 59 .nr_balance_failed = 0, \
61} 60}
62#endif
63 61
64#endif 62#endif
65 63