aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2007-05-02 13:27:09 -0400
committerAndi Kleen <andi@basil.nowhere.org>2007-05-02 13:27:09 -0400
commit14694d736bb66d0ec250d05c81c6e98a19c229c6 (patch)
tree76e752f310859c9904ee772068b2915b138e6572
parent8b8ca80e192b10eecc01fc44a2902510af86f73b (diff)
[PATCH] x86-64: split remaining fake nodes equally
Extends the numa=fake x86_64 command-line option to split the remaining system memory into equal-sized nodes. For example: numa=fake=2*512,4* gives two 512M nodes and the remaining system memory is split into four approximately equal chunks. This is beneficial for systems where the exact size of RAM is unknown or not necessarily relevant, but the granularity with which nodes shall be allocated is known. Cc: Andi Kleen <ak@suse.de> Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Paul Jackson <pj@sgi.com> Cc: Christoph Lameter <clameter@engr.sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--Documentation/x86_64/boot-options.txt4
-rw-r--r--arch/x86_64/mm/numa.c22
2 files changed, 21 insertions, 5 deletions
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt
index 7500aad95f3c..12a9aacecaae 100644
--- a/Documentation/x86_64/boot-options.txt
+++ b/Documentation/x86_64/boot-options.txt
@@ -155,7 +155,9 @@ NUMA
155 depending on the sizes and coefficients listed. For example: 155 depending on the sizes and coefficients listed. For example:
156 numa=fake=2*512,1024,4*256 156 numa=fake=2*512,1024,4*256
157 gives two 512M nodes, a 1024M node, and four 256M nodes. The 157 gives two 512M nodes, a 1024M node, and four 256M nodes. The
158 remaining system RAM is allocated to an additional node. 158 remaining system RAM is allocated to an additional node. If
159 the last character of CMDLINE is a *, the remaining system RAM
160 is instead divided up equally among its coefficient.
159 161
160 numa=hotadd=percent 162 numa=hotadd=percent
161 Only allow hotadd memory to preallocate page structures upto 163 Only allow hotadd memory to preallocate page structures upto
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c
index c55936bc6be6..0ae2d9d5d7ea 100644
--- a/arch/x86_64/mm/numa.c
+++ b/arch/x86_64/mm/numa.c
@@ -418,11 +418,25 @@ static int __init numa_emulation(unsigned long start_pfn, unsigned long end_pfn)
418done: 418done:
419 if (!num_nodes) 419 if (!num_nodes)
420 return -1; 420 return -1;
421 /* Fill remainder of system RAM with a final node, if appropriate. */ 421 /* Fill remainder of system RAM, if appropriate. */
422 if (addr < max_addr) { 422 if (addr < max_addr) {
423 setup_node_range(num_nodes, nodes, &addr, max_addr - addr, 423 switch (*(cmdline - 1)) {
424 max_addr); 424 case '*':
425 num_nodes++; 425 /* Split remaining nodes into coeff chunks */
426 if (coeff <= 0)
427 break;
428 num_nodes += split_nodes_equally(nodes, &addr, max_addr,
429 num_nodes, coeff);
430 break;
431 case ',':
432 /* Do not allocate remaining system RAM */
433 break;
434 default:
435 /* Give one final node */
436 setup_node_range(num_nodes, nodes, &addr,
437 max_addr - addr, max_addr);
438 num_nodes++;
439 }
426 } 440 }
427out: 441out:
428 memnode_shift = compute_hash_shift(nodes, num_nodes); 442 memnode_shift = compute_hash_shift(nodes, num_nodes);