diff options
Diffstat (limited to 'arch/x86/mm/discontig_32.c')
-rw-r--r-- | arch/x86/mm/discontig_32.c | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/arch/x86/mm/discontig_32.c b/arch/x86/mm/discontig_32.c index 914ccf983687..8b4eac0ca07d 100644 --- a/arch/x86/mm/discontig_32.c +++ b/arch/x86/mm/discontig_32.c | |||
@@ -156,7 +156,7 @@ static void __init propagate_e820_map_node(int nid) | |||
156 | */ | 156 | */ |
157 | static void __init allocate_pgdat(int nid) | 157 | static void __init allocate_pgdat(int nid) |
158 | { | 158 | { |
159 | if (nid && node_has_online_mem(nid)) | 159 | if (nid && node_has_online_mem(nid) && node_remap_start_vaddr[nid]) |
160 | NODE_DATA(nid) = (pg_data_t *)node_remap_start_vaddr[nid]; | 160 | NODE_DATA(nid) = (pg_data_t *)node_remap_start_vaddr[nid]; |
161 | else { | 161 | else { |
162 | NODE_DATA(nid) = (pg_data_t *)(pfn_to_kaddr(min_low_pfn)); | 162 | NODE_DATA(nid) = (pg_data_t *)(pfn_to_kaddr(min_low_pfn)); |
@@ -164,16 +164,13 @@ static void __init allocate_pgdat(int nid) | |||
164 | } | 164 | } |
165 | } | 165 | } |
166 | 166 | ||
167 | #ifdef CONFIG_DISCONTIGMEM | ||
168 | /* | 167 | /* |
169 | * In the discontig memory model, a portion of the kernel virtual area (KVA) | 168 | * In the DISCONTIGMEM and SPARSEMEM memory model, a portion of the kernel |
170 | * is reserved and portions of nodes are mapped using it. This is to allow | 169 | * virtual address space (KVA) is reserved and portions of nodes are mapped |
171 | * node-local memory to be allocated for structures that would normally require | 170 | * using it. This is to allow node-local memory to be allocated for |
172 | * ZONE_NORMAL. The memory is allocated with alloc_remap() and callers | 171 | * structures that would normally require ZONE_NORMAL. The memory is |
173 | * should be prepared to allocate from the bootmem allocator instead. This KVA | 172 | * allocated with alloc_remap() and callers should be prepared to allocate |
174 | * mechanism is incompatible with SPARSEMEM as it makes assumptions about the | 173 | * from the bootmem allocator instead. |
175 | * layout of memory that are broken if alloc_remap() succeeds for some of the | ||
176 | * map and fails for others | ||
177 | */ | 174 | */ |
178 | static unsigned long node_remap_start_pfn[MAX_NUMNODES]; | 175 | static unsigned long node_remap_start_pfn[MAX_NUMNODES]; |
179 | static void *node_remap_end_vaddr[MAX_NUMNODES]; | 176 | static void *node_remap_end_vaddr[MAX_NUMNODES]; |
@@ -290,25 +287,6 @@ static void init_remap_allocator(int nid) | |||
290 | (ulong) pfn_to_kaddr(highstart_pfn | 287 | (ulong) pfn_to_kaddr(highstart_pfn |
291 | + node_remap_offset[nid] + node_remap_size[nid])); | 288 | + node_remap_offset[nid] + node_remap_size[nid])); |
292 | } | 289 | } |
293 | #else | ||
294 | void *alloc_remap(int nid, unsigned long size) | ||
295 | { | ||
296 | return NULL; | ||
297 | } | ||
298 | |||
299 | static unsigned long calculate_numa_remap_pages(void) | ||
300 | { | ||
301 | return 0; | ||
302 | } | ||
303 | |||
304 | static void init_remap_allocator(int nid) | ||
305 | { | ||
306 | } | ||
307 | |||
308 | void __init remap_numa_kva(void) | ||
309 | { | ||
310 | } | ||
311 | #endif /* CONFIG_DISCONTIGMEM */ | ||
312 | 290 | ||
313 | extern void setup_bootmem_allocator(void); | 291 | extern void setup_bootmem_allocator(void); |
314 | unsigned long __init setup_memory(void) | 292 | unsigned long __init setup_memory(void) |
@@ -476,3 +454,21 @@ int memory_add_physaddr_to_nid(u64 addr) | |||
476 | 454 | ||
477 | EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); | 455 | EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); |
478 | #endif | 456 | #endif |
457 | |||
458 | #if defined(CONFIG_ACPI_NUMA) && !defined(CONFIG_HAVE_ARCH_PARSE_SRAT) | ||
459 | /* | ||
460 | * Dummy on 32-bit, for now: | ||
461 | */ | ||
462 | void __init acpi_numa_slit_init(struct acpi_table_slit *slit) | ||
463 | { | ||
464 | } | ||
465 | |||
466 | void __init | ||
467 | acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa) | ||
468 | { | ||
469 | } | ||
470 | |||
471 | void __init acpi_numa_arch_fixup(void) | ||
472 | { | ||
473 | } | ||
474 | #endif | ||