diff options
-rw-r--r-- | arch/ia64/include/asm/mmzone.h | 4 | ||||
-rw-r--r-- | arch/ia64/mm/numa.c | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/mmzone_32.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/mmzone_64.h | 2 | ||||
-rw-r--r-- | arch/x86/mm/numa_64.c | 2 | ||||
-rw-r--r-- | include/linux/mm.h | 19 | ||||
-rw-r--r-- | mm/page_alloc.c | 8 |
7 files changed, 25 insertions, 14 deletions
diff --git a/arch/ia64/include/asm/mmzone.h b/arch/ia64/include/asm/mmzone.h index 34efe88eb849..f2ca32069b3f 100644 --- a/arch/ia64/include/asm/mmzone.h +++ b/arch/ia64/include/asm/mmzone.h | |||
@@ -31,10 +31,6 @@ static inline int pfn_to_nid(unsigned long pfn) | |||
31 | #endif | 31 | #endif |
32 | } | 32 | } |
33 | 33 | ||
34 | #ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID | ||
35 | extern int early_pfn_to_nid(unsigned long pfn); | ||
36 | #endif | ||
37 | |||
38 | #ifdef CONFIG_IA64_DIG /* DIG systems are small */ | 34 | #ifdef CONFIG_IA64_DIG /* DIG systems are small */ |
39 | # define MAX_PHYSNODE_ID 8 | 35 | # define MAX_PHYSNODE_ID 8 |
40 | # define NR_NODE_MEMBLKS (MAX_NUMNODES * 8) | 36 | # define NR_NODE_MEMBLKS (MAX_NUMNODES * 8) |
diff --git a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c index b73bf1838e57..5061c3fb6796 100644 --- a/arch/ia64/mm/numa.c +++ b/arch/ia64/mm/numa.c | |||
@@ -58,7 +58,7 @@ paddr_to_nid(unsigned long paddr) | |||
58 | * SPARSEMEM to allocate the SPARSEMEM sectionmap on the NUMA node where | 58 | * SPARSEMEM to allocate the SPARSEMEM sectionmap on the NUMA node where |
59 | * the section resides. | 59 | * the section resides. |
60 | */ | 60 | */ |
61 | int early_pfn_to_nid(unsigned long pfn) | 61 | int __meminit __early_pfn_to_nid(unsigned long pfn) |
62 | { | 62 | { |
63 | int i, section = pfn >> PFN_SECTION_SHIFT, ssec, esec; | 63 | int i, section = pfn >> PFN_SECTION_SHIFT, ssec, esec; |
64 | 64 | ||
diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h index 07f1af494ca5..105fb90a0635 100644 --- a/arch/x86/include/asm/mmzone_32.h +++ b/arch/x86/include/asm/mmzone_32.h | |||
@@ -32,8 +32,6 @@ static inline void get_memcfg_numa(void) | |||
32 | get_memcfg_numa_flat(); | 32 | get_memcfg_numa_flat(); |
33 | } | 33 | } |
34 | 34 | ||
35 | extern int early_pfn_to_nid(unsigned long pfn); | ||
36 | |||
37 | extern void resume_map_numa_kva(pgd_t *pgd); | 35 | extern void resume_map_numa_kva(pgd_t *pgd); |
38 | 36 | ||
39 | #else /* !CONFIG_NUMA */ | 37 | #else /* !CONFIG_NUMA */ |
diff --git a/arch/x86/include/asm/mmzone_64.h b/arch/x86/include/asm/mmzone_64.h index a5b3817d4b9e..a29f48c2a322 100644 --- a/arch/x86/include/asm/mmzone_64.h +++ b/arch/x86/include/asm/mmzone_64.h | |||
@@ -40,8 +40,6 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) | |||
40 | #define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ | 40 | #define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ |
41 | NODE_DATA(nid)->node_spanned_pages) | 41 | NODE_DATA(nid)->node_spanned_pages) |
42 | 42 | ||
43 | extern int early_pfn_to_nid(unsigned long pfn); | ||
44 | |||
45 | #ifdef CONFIG_NUMA_EMU | 43 | #ifdef CONFIG_NUMA_EMU |
46 | #define FAKE_NODE_MIN_SIZE (64 * 1024 * 1024) | 44 | #define FAKE_NODE_MIN_SIZE (64 * 1024 * 1024) |
47 | #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL)) | 45 | #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL)) |
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index 71a14f89f89e..f3516da035d1 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -145,7 +145,7 @@ int __init compute_hash_shift(struct bootnode *nodes, int numnodes, | |||
145 | return shift; | 145 | return shift; |
146 | } | 146 | } |
147 | 147 | ||
148 | int early_pfn_to_nid(unsigned long pfn) | 148 | int __meminit __early_pfn_to_nid(unsigned long pfn) |
149 | { | 149 | { |
150 | return phys_to_nid(pfn << PAGE_SHIFT); | 150 | return phys_to_nid(pfn << PAGE_SHIFT); |
151 | } | 151 | } |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 10074212a35b..065cdf8c09fb 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1041,10 +1041,23 @@ extern void free_bootmem_with_active_regions(int nid, | |||
1041 | typedef int (*work_fn_t)(unsigned long, unsigned long, void *); | 1041 | typedef int (*work_fn_t)(unsigned long, unsigned long, void *); |
1042 | extern void work_with_active_regions(int nid, work_fn_t work_fn, void *data); | 1042 | extern void work_with_active_regions(int nid, work_fn_t work_fn, void *data); |
1043 | extern void sparse_memory_present_with_active_regions(int nid); | 1043 | extern void sparse_memory_present_with_active_regions(int nid); |
1044 | #ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID | ||
1045 | extern int early_pfn_to_nid(unsigned long pfn); | ||
1046 | #endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ | ||
1047 | #endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ | 1044 | #endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ |
1045 | |||
1046 | #if !defined(CONFIG_ARCH_POPULATES_NODE_MAP) && \ | ||
1047 | !defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID) | ||
1048 | static inline int __early_pfn_to_nid(unsigned long pfn) | ||
1049 | { | ||
1050 | return 0; | ||
1051 | } | ||
1052 | #else | ||
1053 | /* please see mm/page_alloc.c */ | ||
1054 | extern int __meminit early_pfn_to_nid(unsigned long pfn); | ||
1055 | #ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID | ||
1056 | /* there is a per-arch backend function. */ | ||
1057 | extern int __meminit __early_pfn_to_nid(unsigned long pfn); | ||
1058 | #endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ | ||
1059 | #endif | ||
1060 | |||
1048 | extern void set_dma_reserve(unsigned long new_dma_reserve); | 1061 | extern void set_dma_reserve(unsigned long new_dma_reserve); |
1049 | extern void memmap_init_zone(unsigned long, int, unsigned long, | 1062 | extern void memmap_init_zone(unsigned long, int, unsigned long, |
1050 | unsigned long, enum memmap_context); | 1063 | unsigned long, enum memmap_context); |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 5675b3073854..c5dd74602efc 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -2989,7 +2989,7 @@ static int __meminit next_active_region_index_in_nid(int index, int nid) | |||
2989 | * was used and there are no special requirements, this is a convenient | 2989 | * was used and there are no special requirements, this is a convenient |
2990 | * alternative | 2990 | * alternative |
2991 | */ | 2991 | */ |
2992 | int __meminit early_pfn_to_nid(unsigned long pfn) | 2992 | int __meminit __early_pfn_to_nid(unsigned long pfn) |
2993 | { | 2993 | { |
2994 | int i; | 2994 | int i; |
2995 | 2995 | ||
@@ -3005,6 +3005,12 @@ int __meminit early_pfn_to_nid(unsigned long pfn) | |||
3005 | } | 3005 | } |
3006 | #endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ | 3006 | #endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ |
3007 | 3007 | ||
3008 | int __meminit early_pfn_to_nid(unsigned long pfn) | ||
3009 | { | ||
3010 | return __early_pfn_to_nid(pfn); | ||
3011 | } | ||
3012 | |||
3013 | |||
3008 | /* Basic iterator support to walk early_node_map[] */ | 3014 | /* Basic iterator support to walk early_node_map[] */ |
3009 | #define for_each_active_range_index_in_nid(i, nid) \ | 3015 | #define for_each_active_range_index_in_nid(i, nid) \ |
3010 | for (i = first_active_region_index_in_nid(nid); i != -1; \ | 3016 | for (i = first_active_region_index_in_nid(nid); i != -1; \ |