diff options
-rw-r--r-- | arch/x86/include/asm/numa.h | 1 | ||||
-rw-r--r-- | arch/x86/mm/numa.c | 34 | ||||
-rw-r--r-- | mm/page_alloc.c | 2 |
3 files changed, 16 insertions, 21 deletions
diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h index 4064acae625d..01b493e5a99b 100644 --- a/arch/x86/include/asm/numa.h +++ b/arch/x86/include/asm/numa.h | |||
@@ -9,7 +9,6 @@ | |||
9 | #ifdef CONFIG_NUMA | 9 | #ifdef CONFIG_NUMA |
10 | 10 | ||
11 | #define NR_NODE_MEMBLKS (MAX_NUMNODES*2) | 11 | #define NR_NODE_MEMBLKS (MAX_NUMNODES*2) |
12 | #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) | ||
13 | 12 | ||
14 | /* | 13 | /* |
15 | * Too small node sizes may confuse the VM badly. Usually they | 14 | * Too small node sizes may confuse the VM badly. Usually they |
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index a32b706c401a..d221374d5ce8 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c | |||
@@ -185,8 +185,8 @@ int __init numa_add_memblk(int nid, u64 start, u64 end) | |||
185 | return numa_add_memblk_to(nid, start, end, &numa_meminfo); | 185 | return numa_add_memblk_to(nid, start, end, &numa_meminfo); |
186 | } | 186 | } |
187 | 187 | ||
188 | /* Initialize NODE_DATA for a node on the local memory */ | 188 | /* Allocate NODE_DATA for a node on the local memory */ |
189 | static void __init setup_node_data(int nid, u64 start, u64 end) | 189 | static void __init alloc_node_data(int nid) |
190 | { | 190 | { |
191 | const size_t nd_size = roundup(sizeof(pg_data_t), PAGE_SIZE); | 191 | const size_t nd_size = roundup(sizeof(pg_data_t), PAGE_SIZE); |
192 | u64 nd_pa; | 192 | u64 nd_pa; |
@@ -194,18 +194,6 @@ static void __init setup_node_data(int nid, u64 start, u64 end) | |||
194 | int tnid; | 194 | int tnid; |
195 | 195 | ||
196 | /* | 196 | /* |
197 | * Don't confuse VM with a node that doesn't have the | ||
198 | * minimum amount of memory: | ||
199 | */ | ||
200 | if (end && (end - start) < NODE_MIN_SIZE) | ||
201 | return; | ||
202 | |||
203 | start = roundup(start, ZONE_ALIGN); | ||
204 | |||
205 | printk(KERN_INFO "Initmem setup node %d [mem %#010Lx-%#010Lx]\n", | ||
206 | nid, start, end - 1); | ||
207 | |||
208 | /* | ||
209 | * Allocate node data. Try node-local memory and then any node. | 197 | * Allocate node data. Try node-local memory and then any node. |
210 | * Never allocate in DMA zone. | 198 | * Never allocate in DMA zone. |
211 | */ | 199 | */ |
@@ -222,7 +210,7 @@ static void __init setup_node_data(int nid, u64 start, u64 end) | |||
222 | nd = __va(nd_pa); | 210 | nd = __va(nd_pa); |
223 | 211 | ||
224 | /* report and initialize */ | 212 | /* report and initialize */ |
225 | printk(KERN_INFO " NODE_DATA [mem %#010Lx-%#010Lx]\n", | 213 | printk(KERN_INFO "NODE_DATA(%d) allocated [mem %#010Lx-%#010Lx]\n", nid, |
226 | nd_pa, nd_pa + nd_size - 1); | 214 | nd_pa, nd_pa + nd_size - 1); |
227 | tnid = early_pfn_to_nid(nd_pa >> PAGE_SHIFT); | 215 | tnid = early_pfn_to_nid(nd_pa >> PAGE_SHIFT); |
228 | if (tnid != nid) | 216 | if (tnid != nid) |
@@ -230,9 +218,6 @@ static void __init setup_node_data(int nid, u64 start, u64 end) | |||
230 | 218 | ||
231 | node_data[nid] = nd; | 219 | node_data[nid] = nd; |
232 | memset(NODE_DATA(nid), 0, sizeof(pg_data_t)); | 220 | memset(NODE_DATA(nid), 0, sizeof(pg_data_t)); |
233 | NODE_DATA(nid)->node_id = nid; | ||
234 | NODE_DATA(nid)->node_start_pfn = start >> PAGE_SHIFT; | ||
235 | NODE_DATA(nid)->node_spanned_pages = (end - start) >> PAGE_SHIFT; | ||
236 | 221 | ||
237 | node_set_online(nid); | 222 | node_set_online(nid); |
238 | } | 223 | } |
@@ -523,8 +508,17 @@ static int __init numa_register_memblks(struct numa_meminfo *mi) | |||
523 | end = max(mi->blk[i].end, end); | 508 | end = max(mi->blk[i].end, end); |
524 | } | 509 | } |
525 | 510 | ||
526 | if (start < end) | 511 | if (start >= end) |
527 | setup_node_data(nid, start, end); | 512 | continue; |
513 | |||
514 | /* | ||
515 | * Don't confuse VM with a node that doesn't have the | ||
516 | * minimum amount of memory: | ||
517 | */ | ||
518 | if (end && (end - start) < NODE_MIN_SIZE) | ||
519 | continue; | ||
520 | |||
521 | alloc_node_data(nid); | ||
528 | } | 522 | } |
529 | 523 | ||
530 | /* Dump memblock with node info and return. */ | 524 | /* Dump memblock with node info and return. */ |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 18cee0d4c8a2..d0e3d2fee585 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -4976,6 +4976,8 @@ void __paginginit free_area_init_node(int nid, unsigned long *zones_size, | |||
4976 | pgdat->node_start_pfn = node_start_pfn; | 4976 | pgdat->node_start_pfn = node_start_pfn; |
4977 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 4977 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
4978 | get_pfn_range_for_nid(nid, &start_pfn, &end_pfn); | 4978 | get_pfn_range_for_nid(nid, &start_pfn, &end_pfn); |
4979 | printk(KERN_INFO "Initmem setup node %d [mem %#010Lx-%#010Lx]\n", nid, | ||
4980 | (u64) start_pfn << PAGE_SHIFT, (u64) (end_pfn << PAGE_SHIFT) - 1); | ||
4979 | #endif | 4981 | #endif |
4980 | calculate_node_totalpages(pgdat, start_pfn, end_pfn, | 4982 | calculate_node_totalpages(pgdat, start_pfn, end_pfn, |
4981 | zones_size, zholes_size); | 4983 | zones_size, zholes_size); |