mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86: Fix calculation of size of numa_distance
@ 2011-02-25 14:57 Jack Steiner
  2011-02-25 15:03 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Jack Steiner @ 2011-02-25 14:57 UTC (permalink / raw)
  To: yinghai, mingo, tglx; +Cc: linux-kernel

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);

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

* Re: [PATCH] x86: Fix calculation of size of numa_distance
  2011-02-25 14:57 [PATCH] x86: Fix calculation of size of numa_distance Jack Steiner
@ 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
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Molnar @ 2011-02-25 15:03 UTC (permalink / raw)
  To: Jack Steiner, Tejun Heo; +Cc: yinghai, tglx, linux-kernel


* Jack Steiner <steiner@sgi.com> wrote:

> 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);

Tejun has queued up a fix for this already. Tejun, mind sending the fix to me ASAP?

Thanks,

	Ingo

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

* [GIT PULL tip:x86/mm] fix incorrect NUMA distance table size calculation
  2011-02-25 15:03 ` Ingo Molnar
@ 2011-02-25 15:06   ` Tejun Heo
  0 siblings, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2011-02-25 15:06 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Jack Steiner, yinghai, tglx, linux-kernel

Please pull from the following branch to receive NUMA distance table
size fix.

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git x86-mm

David Rientjes (1):
      x86-64, NUMA: Fix size of numa_distance array

 arch/x86/mm/numa_64.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Thanks.

-- 
tejun

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

end of thread, other threads:[~2011-02-25 15:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-25 14:57 [PATCH] x86: Fix calculation of size of numa_distance Jack Steiner
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

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®