diff options
author | David Rientjes <rientjes@google.com> | 2010-02-15 16:43:25 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-02-15 17:34:04 -0500 |
commit | 68fd111e02b979876359c7b471a8bcbca0628b75 (patch) | |
tree | 6b8cd2a098fd5bbe6ced2a7c313c52ae3bf48d59 /arch/x86/mm/numa_64.c | |
parent | 0271f91003d3703675be13b8865618359a6caa1f (diff) |
x86, numa: Fix numa emulation calculation of big nodes
numa=fake=N uses split_nodes_interleave() to partition the system into N
fake nodes. Each node size must have be a multiple of
FAKE_NODE_MIN_SIZE, otherwise it is possible to get strange alignments.
Because of this, the remaining memory from each node when rounded to
FAKE_NODE_MIN_SIZE is consolidated into a number of "big nodes" that are
bigger than the rest.
The calculation of the number of big nodes is incorrect since it is using
a logical AND operator when it should be multiplying the rounded-off
portion of each node with N.
Signed-off-by: David Rientjes <rientjes@google.com>
LKML-Reference: <alpine.DEB.2.00.1002151342230.26927@chino.kir.corp.google.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/mm/numa_64.c')
-rw-r--r-- | arch/x86/mm/numa_64.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index 83bbc70d11bb..2ecbe0ca0dfc 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -427,7 +427,7 @@ static int __init split_nodes_interleave(u64 addr, u64 max_addr, | |||
427 | * Calculate the number of big nodes that can be allocated as a result | 427 | * Calculate the number of big nodes that can be allocated as a result |
428 | * of consolidating the remainder. | 428 | * of consolidating the remainder. |
429 | */ | 429 | */ |
430 | big = ((size & ~FAKE_NODE_MIN_HASH_MASK) & nr_nodes) / | 430 | big = ((size & ~FAKE_NODE_MIN_HASH_MASK) * nr_nodes) / |
431 | FAKE_NODE_MIN_SIZE; | 431 | FAKE_NODE_MIN_SIZE; |
432 | 432 | ||
433 | size &= FAKE_NODE_MIN_HASH_MASK; | 433 | size &= FAKE_NODE_MIN_HASH_MASK; |