public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 1/3] x86: fix numa emulation calculation of big nodes
@ 2010-02-15 21:43 David Rientjes
  2010-02-15 21:43 ` [patch 2/3] x86: add fixed node size option for numa emulation David Rientjes
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: David Rientjes @ 2010-02-15 21:43 UTC (permalink / raw)
  To: Ingo Molnar, H. Peter Anvin, Thomas Gleixner; +Cc: x86, linux-kernel

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>
---
 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
--- 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,
 	 * Calculate the number of big nodes that can be allocated as a result
 	 * of consolidating the remainder.
 	 */
-	big = ((size & ~FAKE_NODE_MIN_HASH_MASK) & nr_nodes) /
+	big = ((size & ~FAKE_NODE_MIN_HASH_MASK) * nr_nodes) /
 		FAKE_NODE_MIN_SIZE;
 
 	size &= FAKE_NODE_MIN_HASH_MASK;

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-02-16  0:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-15 21:43 [patch 1/3] x86: fix numa emulation calculation of big nodes David Rientjes
2010-02-15 21:43 ` [patch 2/3] x86: add fixed node size option for numa emulation David Rientjes
2010-02-16  0:19   ` [tip:x86/numa] x86, numa: Add " tip-bot for David Rientjes
2010-02-15 21:43 ` [patch 3/3] x86: remove configurable node size support " David Rientjes
2010-02-16  0:19   ` [tip:x86/numa] x86, numa: Remove " tip-bot for David Rientjes
2010-02-16  0:18 ` [tip:x86/numa] x86, numa: Fix numa emulation calculation of big nodes tip-bot for David Rientjes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox