public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for David Rientjes <rientjes@google.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	tglx@linutronix.de, rientjes@google.com
Subject: [tip:x86/numa] x86, numa: Fix numa emulation calculation of big nodes
Date: Tue, 16 Feb 2010 00:18:43 GMT	[thread overview]
Message-ID: <tip-68fd111e02b979876359c7b471a8bcbca0628b75@git.kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1002151342230.26927@chino.kir.corp.google.com>

Commit-ID:  68fd111e02b979876359c7b471a8bcbca0628b75
Gitweb:     http://git.kernel.org/tip/68fd111e02b979876359c7b471a8bcbca0628b75
Author:     David Rientjes <rientjes@google.com>
AuthorDate: Mon, 15 Feb 2010 13:43:25 -0800
Committer:  H. Peter Anvin <hpa@zytor.com>
CommitDate: Mon, 15 Feb 2010 14:34:04 -0800

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>
---
 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 83bbc70..2ecbe0c 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,
 	 * 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;

      parent reply	other threads:[~2010-02-16  0:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-bot for David Rientjes [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-68fd111e02b979876359c7b471a8bcbca0628b75@git.kernel.org \
    --to=rientjes@google.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox