summaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c47
1 files changed, 28 insertions, 19 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 8ab5e5e7fdad..3c7ea45ffba9 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -182,28 +182,31 @@ static unsigned long __meminitdata nr_all_pages;
182static unsigned long __meminitdata dma_reserve; 182static unsigned long __meminitdata dma_reserve;
183 183
184#ifdef CONFIG_ARCH_POPULATES_NODE_MAP 184#ifdef CONFIG_ARCH_POPULATES_NODE_MAP
185 /* 185 #ifndef CONFIG_HAVE_MEMBLOCK_NODE_MAP
186 * MAX_ACTIVE_REGIONS determines the maximum number of distinct 186 /*
187 * ranges of memory (RAM) that may be registered with add_active_range(). 187 * MAX_ACTIVE_REGIONS determines the maximum number of distinct ranges
188 * Ranges passed to add_active_range() will be merged if possible 188 * of memory (RAM) that may be registered with add_active_range().
189 * so the number of times add_active_range() can be called is 189 * Ranges passed to add_active_range() will be merged if possible so
190 * related to the number of nodes and the number of holes 190 * the number of times add_active_range() can be called is related to
191 */ 191 * the number of nodes and the number of holes
192 #ifdef CONFIG_MAX_ACTIVE_REGIONS 192 */
193 /* Allow an architecture to set MAX_ACTIVE_REGIONS to save memory */ 193 #ifdef CONFIG_MAX_ACTIVE_REGIONS
194 #define MAX_ACTIVE_REGIONS CONFIG_MAX_ACTIVE_REGIONS 194 /* Allow an architecture to set MAX_ACTIVE_REGIONS to save memory */
195 #else 195 #define MAX_ACTIVE_REGIONS CONFIG_MAX_ACTIVE_REGIONS
196 #if MAX_NUMNODES >= 32
197 /* If there can be many nodes, allow up to 50 holes per node */
198 #define MAX_ACTIVE_REGIONS (MAX_NUMNODES*50)
199 #else 196 #else
200 /* By default, allow up to 256 distinct regions */ 197 #if MAX_NUMNODES >= 32
201 #define MAX_ACTIVE_REGIONS 256 198 /* If there can be many nodes, allow up to 50 holes per node */
199 #define MAX_ACTIVE_REGIONS (MAX_NUMNODES*50)
200 #else
201 /* By default, allow up to 256 distinct regions */
202 #define MAX_ACTIVE_REGIONS 256
203 #endif
202 #endif 204 #endif
203 #endif
204 205
205 static struct node_active_region __meminitdata early_node_map[MAX_ACTIVE_REGIONS]; 206 static struct node_active_region __meminitdata early_node_map[MAX_ACTIVE_REGIONS];
206 static int __meminitdata nr_nodemap_entries; 207 static int __meminitdata nr_nodemap_entries;
208#endif /* !CONFIG_HAVE_MEMBLOCK_NODE_MAP */
209
207 static unsigned long __meminitdata arch_zone_lowest_possible_pfn[MAX_NR_ZONES]; 210 static unsigned long __meminitdata arch_zone_lowest_possible_pfn[MAX_NR_ZONES];
208 static unsigned long __meminitdata arch_zone_highest_possible_pfn[MAX_NR_ZONES]; 211 static unsigned long __meminitdata arch_zone_highest_possible_pfn[MAX_NR_ZONES];
209 static unsigned long __initdata required_kernelcore; 212 static unsigned long __initdata required_kernelcore;
@@ -4268,6 +4271,7 @@ static inline void setup_nr_node_ids(void)
4268} 4271}
4269#endif 4272#endif
4270 4273
4274#ifndef CONFIG_HAVE_MEMBLOCK_NODE_MAP
4271/* 4275/*
4272 * Common iterator interface used to define for_each_mem_pfn_range(). 4276 * Common iterator interface used to define for_each_mem_pfn_range().
4273 */ 4277 */
@@ -4456,6 +4460,11 @@ void __init sort_node_map(void)
4456 sizeof(struct node_active_region), 4460 sizeof(struct node_active_region),
4457 cmp_node_active_region, NULL); 4461 cmp_node_active_region, NULL);
4458} 4462}
4463#else /* !CONFIG_HAVE_MEMBLOCK_NODE_MAP */
4464static inline void sort_node_map(void)
4465{
4466}
4467#endif
4459 4468
4460/** 4469/**
4461 * node_map_pfn_alignment - determine the maximum internode alignment 4470 * node_map_pfn_alignment - determine the maximum internode alignment