All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] x86, numa, emu: move size calculation into if block
@ 2011-03-03  1:25 Yinghai Lu
  2011-03-03  1:28 ` [PATCH 2/2] x86, numa, emu: only transform numa_distance if SLIT is there Yinghai Lu
  2011-03-03  6:21 ` [PATCH 1/2] x86, numa, emu: move size calculation into if block Tejun Heo
  0 siblings, 2 replies; 5+ messages in thread
From: Yinghai Lu @ 2011-03-03  1:25 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Tejun Heo,
	David Rientjes
  Cc: linux-kernel@vger.kernel.org



don't need to assign them that early.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/mm/numa_64.c        |   11 +++++------
 arch/x86/mm/numa_emulation.c |    3 ++-
 2 files changed, 7 insertions(+), 7 deletions(-)

Index: linux-2.6/arch/x86/mm/numa_64.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/numa_64.c
+++ linux-2.6/arch/x86/mm/numa_64.c
@@ -390,13 +390,12 @@ static void __init numa_nodemask_from_me
  */
 void __init numa_reset_distance(void)
 {
-	size_t size = numa_distance_cnt * numa_distance_cnt * sizeof(numa_distance[0]);
-
 	/* numa_distance could be 1LU marking allocation failure, test cnt */
-	if (numa_distance_cnt)
-		memblock_x86_free_range(__pa(numa_distance),
-					__pa(numa_distance) + size);
-	numa_distance_cnt = 0;
+	if (numa_distance_cnt) {
+		size_t size = numa_distance_cnt * numa_distance_cnt * sizeof(numa_distance[0]);
+		memblock_x86_free_range(__pa(numa_distance), __pa(numa_distance) + size);
+		numa_distance_cnt = 0;
+	}
 	numa_distance = NULL;	/* enable table creation */
 }
 
Index: linux-2.6/arch/x86/mm/numa_emulation.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/numa_emulation.c
+++ linux-2.6/arch/x86/mm/numa_emulation.c
@@ -300,7 +300,7 @@ void __init numa_emulation(struct numa_m
 	static struct numa_meminfo pi __initdata;
 	const u64 max_addr = max_pfn << PAGE_SHIFT;
 	u8 *phys_dist = NULL;
-	size_t phys_size = numa_dist_cnt * numa_dist_cnt * sizeof(phys_dist[0]);
+	size_t phys_size = 0;
 	int i, j, ret;
 
 	if (!emu_cmdline)
@@ -341,6 +341,7 @@ void __init numa_emulation(struct numa_m
 	if (numa_dist_cnt) {
 		u64 phys;
 
+		phys_size = numa_dist_cnt * numa_dist_cnt * sizeof(phys_dist[0]);
 		phys = memblock_find_in_range(0,
 					      (u64)max_pfn_mapped << PAGE_SHIFT,
 					      phys_size, PAGE_SIZE);

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

end of thread, other threads:[~2011-03-10  8:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-03  1:25 [PATCH 1/2] x86, numa, emu: move size calculation into if block Yinghai Lu
2011-03-03  1:28 ` [PATCH 2/2] x86, numa, emu: only transform numa_distance if SLIT is there Yinghai Lu
2011-03-03  6:22   ` Tejun Heo
2011-03-10  8:55     ` Ingo Molnar
2011-03-03  6:21 ` [PATCH 1/2] x86, numa, emu: move size calculation into if block Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.