public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86, UV: Fix for nodes with memory and no cpus
@ 2009-03-30 14:01 Jack Steiner
  2009-04-03 17:51 ` [tip:x86/uv] " Jack Steiner
  0 siblings, 1 reply; 4+ messages in thread
From: Jack Steiner @ 2009-03-30 14:01 UTC (permalink / raw)
  To: mingo, tglx; +Cc: linux-kernel

Fix initialization of UV blade information for systems that have
nodes with memory but no cpus.

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

---
 arch/x86/kernel/apic/x2apic_uv_x.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

Index: linux/arch/x86/kernel/apic/x2apic_uv_x.c
===================================================================
--- linux.orig/arch/x86/kernel/apic/x2apic_uv_x.c	2009-03-30 01:54:51.000000000 -0500
+++ linux/arch/x86/kernel/apic/x2apic_uv_x.c	2009-03-30 08:46:49.000000000 -0500
@@ -555,7 +555,8 @@ void __init uv_system_init(void)
 	unsigned long gnode_upper, lowmem_redir_base, lowmem_redir_size;
 	int bytes, nid, cpu, lcpu, pnode, blade, i, j, m_val, n_val;
 	int max_pnode = 0;
-	unsigned long mmr_base, present;
+	unsigned long mmr_base, present, paddr;
+	unsigned short pnode_mask;
 
 	map_low_mmrs();
 
@@ -598,6 +599,7 @@ void __init uv_system_init(void)
 		}
 	}
 
+	pnode_mask = (1 << n_val) - 1;
 	node_id.v = uv_read_local_mmr(UVH_NODE_ID);
 	gnode_upper = (((unsigned long)node_id.s.node_id) &
 		       ~((1 << n_val) - 1)) << m_val;
@@ -621,7 +623,7 @@ void __init uv_system_init(void)
 		uv_cpu_hub_info(cpu)->numa_blade_id = blade;
 		uv_cpu_hub_info(cpu)->blade_processor_id = lcpu;
 		uv_cpu_hub_info(cpu)->pnode = pnode;
-		uv_cpu_hub_info(cpu)->pnode_mask = (1 << n_val) - 1;
+		uv_cpu_hub_info(cpu)->pnode_mask =pnode_mask;
 		uv_cpu_hub_info(cpu)->gpa_mask = (1 << (m_val + n_val)) - 1;
 		uv_cpu_hub_info(cpu)->gnode_upper = gnode_upper;
 		uv_cpu_hub_info(cpu)->global_mmr_base = mmr_base;
@@ -637,6 +639,16 @@ void __init uv_system_init(void)
 			lcpu, blade);
 	}
 
+	/* Add blade/pnode info for nodes without cpus */
+	for_each_online_node(nid) {
+		if (uv_node_to_blade[nid] >= 0)
+			continue;
+		paddr = node_start_pfn(nid) << PAGE_SHIFT;
+		pnode = (paddr >> m_val) & pnode_mask;
+		blade = boot_pnode_to_blade(pnode);
+		uv_node_to_blade[nid] = blade;
+	}
+
 	map_gru_high(max_pnode);
 	map_mmr_high(max_pnode);
 	map_config_high(max_pnode);

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

* [tip:x86/uv] x86, UV: Fix for nodes with memory and no cpus
  2009-03-30 14:01 [PATCH] x86, UV: Fix for nodes with memory and no cpus Jack Steiner
@ 2009-04-03 17:51 ` Jack Steiner
  2009-04-03 20:05   ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Jack Steiner @ 2009-04-03 17:51 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, steiner, tglx, mingo

Commit-ID:  6a891a24e4d0056c365a90ff2d71c38fd366b0d0
Gitweb:     http://git.kernel.org/tip/6a891a24e4d0056c365a90ff2d71c38fd366b0d0
Author:     Jack Steiner <steiner@sgi.com>
AuthorDate: Mon, 30 Mar 2009 09:01:11 -0500
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 3 Apr 2009 19:49:58 +0200

x86, UV: Fix for nodes with memory and no cpus

Fix initialization of UV blade information for systems that have
nodes with memory but no cpus.

Signed-off-by: Jack Steiner <steiner@sgi.com>
LKML-Reference: <20090330140111.GA18461@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 arch/x86/kernel/apic/x2apic_uv_x.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 1248318..de1a50a 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -549,7 +549,8 @@ void __init uv_system_init(void)
 	unsigned long gnode_upper, lowmem_redir_base, lowmem_redir_size;
 	int bytes, nid, cpu, lcpu, pnode, blade, i, j, m_val, n_val;
 	int max_pnode = 0;
-	unsigned long mmr_base, present;
+	unsigned long mmr_base, present, paddr;
+	unsigned short pnode_mask;
 
 	map_low_mmrs();
 
@@ -592,6 +593,7 @@ void __init uv_system_init(void)
 		}
 	}
 
+	pnode_mask = (1 << n_val) - 1;
 	node_id.v = uv_read_local_mmr(UVH_NODE_ID);
 	gnode_upper = (((unsigned long)node_id.s.node_id) &
 		       ~((1 << n_val) - 1)) << m_val;
@@ -615,7 +617,7 @@ void __init uv_system_init(void)
 		uv_cpu_hub_info(cpu)->numa_blade_id = blade;
 		uv_cpu_hub_info(cpu)->blade_processor_id = lcpu;
 		uv_cpu_hub_info(cpu)->pnode = pnode;
-		uv_cpu_hub_info(cpu)->pnode_mask = (1 << n_val) - 1;
+		uv_cpu_hub_info(cpu)->pnode_mask = pnode_mask;
 		uv_cpu_hub_info(cpu)->gpa_mask = (1 << (m_val + n_val)) - 1;
 		uv_cpu_hub_info(cpu)->gnode_upper = gnode_upper;
 		uv_cpu_hub_info(cpu)->global_mmr_base = mmr_base;
@@ -631,6 +633,16 @@ void __init uv_system_init(void)
 			lcpu, blade);
 	}
 
+	/* Add blade/pnode info for nodes without cpus */
+	for_each_online_node(nid) {
+		if (uv_node_to_blade[nid] >= 0)
+			continue;
+		paddr = node_start_pfn(nid) << PAGE_SHIFT;
+		pnode = (paddr >> m_val) & pnode_mask;
+		blade = boot_pnode_to_blade(pnode);
+		uv_node_to_blade[nid] = blade;
+	}
+
 	map_gru_high(max_pnode);
 	map_mmr_high(max_pnode);
 	map_config_high(max_pnode);

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

* Re: [tip:x86/uv] x86, UV: Fix for nodes with memory and no cpus
  2009-04-03 17:51 ` [tip:x86/uv] " Jack Steiner
@ 2009-04-03 20:05   ` Ingo Molnar
  2009-04-03 20:27     ` Jack Steiner
  0 siblings, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2009-04-03 20:05 UTC (permalink / raw)
  To: Jack Steiner; +Cc: linux-tip-commits, linux-kernel, hpa, mingo, tglx


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

> Commit-ID:  6a891a24e4d0056c365a90ff2d71c38fd366b0d0
> Gitweb:     http://git.kernel.org/tip/6a891a24e4d0056c365a90ff2d71c38fd366b0d0
> Author:     Jack Steiner <steiner@sgi.com>
> AuthorDate: Mon, 30 Mar 2009 09:01:11 -0500
> Committer:  Ingo Molnar <mingo@elte.hu>
> CommitDate: Fri, 3 Apr 2009 19:49:58 +0200
> 
> x86, UV: Fix for nodes with memory and no cpus

Hm, there's a build failure regression here:

arch/x86/kernel/apic/x2apic_uv_x.c: In function ‘uv_system_init’:
arch/x86/kernel/apic/x2apic_uv_x.c:641: error: implicit declaration of function ‘node_start_pfn’

	Ingo

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

* Re: [tip:x86/uv] x86, UV: Fix for nodes with memory and no cpus
  2009-04-03 20:05   ` Ingo Molnar
@ 2009-04-03 20:27     ` Jack Steiner
  0 siblings, 0 replies; 4+ messages in thread
From: Jack Steiner @ 2009-04-03 20:27 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-tip-commits, linux-kernel, hpa, mingo, tglx

On Fri, Apr 03, 2009 at 10:05:38PM +0200, Ingo Molnar wrote:
> 
> * Jack Steiner <steiner@sgi.com> wrote:
> 
> > Commit-ID:  6a891a24e4d0056c365a90ff2d71c38fd366b0d0
> > Gitweb:     http://git.kernel.org/tip/6a891a24e4d0056c365a90ff2d71c38fd366b0d0
> > Author:     Jack Steiner <steiner@sgi.com>
> > AuthorDate: Mon, 30 Mar 2009 09:01:11 -0500
> > Committer:  Ingo Molnar <mingo@elte.hu>
> > CommitDate: Fri, 3 Apr 2009 19:49:58 +0200
> > 
> > x86, UV: Fix for nodes with memory and no cpus
> 
> Hm, there's a build failure regression here:
> 
> arch/x86/kernel/apic/x2apic_uv_x.c: In function ???uv_system_init???:
> arch/x86/kernel/apic/x2apic_uv_x.c:641: error: implicit declaration of function ???node_start_pfn???

What was the config? Looks like node_start_pfn() is not defined for non-NUMA?
If your config was non-NUMA, I'll make UV depend on NUMA.


--- jack

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

end of thread, other threads:[~2009-04-03 20:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-30 14:01 [PATCH] x86, UV: Fix for nodes with memory and no cpus Jack Steiner
2009-04-03 17:51 ` [tip:x86/uv] " Jack Steiner
2009-04-03 20:05   ` Ingo Molnar
2009-04-03 20:27     ` Jack Steiner

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