mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jack Steiner <steiner@sgi.com>
To: yinghai@kernel.org, mingo@elte.hu, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] x86: Fix calculation of size of numa_distance
Date: Fri, 25 Feb 2011 08:57:59 -0600	[thread overview]
Message-ID: <20110225145759.GA1606@sgi.com> (raw)

Fix the calculation of the size of numa_distance array. It is 2-dimemsional
array. This fixes early panics seen on large numa systems.

Signed-off-by: Jack Steiner <steiner@sgi.com>

Index: linux/arch/x86/mm/numa_64.c
===================================================================
--- linux.orig/arch/x86/mm/numa_64.c	2011-02-23 17:46:38.000000000 -0600
+++ linux/arch/x86/mm/numa_64.c	2011-02-25 08:53:45.781921592 -0600
@@ -414,7 +414,8 @@ static int __init numa_alloc_distance(vo
 
 	for_each_node_mask(i, nodes_parsed)
 		cnt = i;
-	size = ++cnt * sizeof(numa_distance[0]);
+	cnt++;
+	size = cnt * cnt * sizeof(numa_distance[0]);
 
 	phys = memblock_find_in_range(0, (u64)max_pfn_mapped << PAGE_SHIFT,
 				      size, PAGE_SIZE);

             reply	other threads:[~2011-02-25 14:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-25 14:57 Jack Steiner [this message]
2011-02-25 15:03 ` Ingo Molnar
2011-02-25 15:06   ` [GIT PULL tip:x86/mm] fix incorrect NUMA distance table size calculation Tejun Heo

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=20110225145759.GA1606@sgi.com \
    --to=steiner@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=yinghai@kernel.org \
    /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

all inboxes | Powered by JetHome®