public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SN - fix pxm_to_nasid() for large machines
@ 2004-02-06 17:38 Martin Hicks
  2004-02-06 17:44 ` Martin Hicks
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Hicks @ 2004-02-06 17:38 UTC (permalink / raw)
  To: linux-ia64

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]


Hi,

This is a patch for SN2 that fixes up pxm_to_nasid() for big machines.
Compile and boot tested.  The patch is against the latest 2.6 bitkeeper.

I also marked sn_init_pdas as __init, because it is.

Thanks
mh

-- 
Martin Hicks                Wild Open Source Inc.
mort@wildopensource.com     613-266-2296

[-- Attachment #2: sn-pxm_to_nasid-fix.patches --]
[-- Type: text/plain, Size: 1879 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1542  -> 1.1543 
#	arch/ia64/sn/kernel/setup.c	1.29    -> 1.30   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/02/06	mort@tomahawk.engr.sgi.com	1.1543
# Correct the pxm_to_nasid() definition so it works correctly for
# the big boxen.
# --------------------------------------------
#
diff -Nru a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
--- a/arch/ia64/sn/kernel/setup.c	Fri Feb  6 08:51:01 2004
+++ b/arch/ia64/sn/kernel/setup.c	Fri Feb  6 08:51:01 2004
@@ -50,8 +50,6 @@
 
 DEFINE_PER_CPU(struct pda_s, pda_percpu);
 
-#define pxm_to_nasid(pxm) ((pxm)<<1)
-
 #define MAX_PHYS_MEMORY		(1UL << 49)     /* 1 TB */
 
 extern void bte_init_node (nodepda_t *, cnodeid_t);
@@ -121,6 +119,29 @@
 char drive_info[4*16];
 #endif
 
+
+/*
+ * This routine can only be used during init, since
+ * smp_boot_data is an init data structure.
+ * We have to use smp_boot_data.cpu_phys_id to find
+ * the physical id of the processor because the normal
+ * cpu_physical_id() relies on data structures that
+ * may not be initialized yet.                                                                     
+ */
+static int __init
+pxm_to_nasid(int pxm)
+{
+	int i;
+	int nid;
+
+	nid = pxm_to_nid_map[pxm];
+	for (i = 0; i < num_memblks; i++)
+		if (node_memblk[i].nid == nid)
+			return NASID_GET(node_memblk[i].start_paddr);
+	return -1;
+}
+
+
 /**
  * early_sn_setup - early setup routine for SN platforms
  *
@@ -315,7 +336,7 @@
  *
  * One time setup for Node Data Area.  Called by sn_setup().
  */
-void
+void __init
 sn_init_pdas(char **cmdline_p)
 {
 	cnodeid_t	cnode;

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

* Re: [PATCH] SN - fix pxm_to_nasid() for large machines
  2004-02-06 17:38 [PATCH] SN - fix pxm_to_nasid() for large machines Martin Hicks
@ 2004-02-06 17:44 ` Martin Hicks
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Hicks @ 2004-02-06 17:44 UTC (permalink / raw)
  To: linux-ia64



On Fri, Feb 06, 2004 at 12:38:38PM -0500, Martin Hicks wrote:
> 
> Hi,
> 
> This is a patch for SN2 that fixes up pxm_to_nasid() for big machines.
> Compile and boot tested.  The patch is against the latest 2.6 bitkeeper.

Jbarnes pointed out to me moments after I sent this out that the basic
patch is already in -mm

Sorry.

> I also marked sn_init_pdas as __init, because it is.

I'll send a patch that adds the __init to these two functions.

mh

-- 
Martin Hicks || mort@bork.org || PGP/GnuPG: 0x4C7F2BEE

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

end of thread, other threads:[~2004-02-06 17:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-06 17:38 [PATCH] SN - fix pxm_to_nasid() for large machines Martin Hicks
2004-02-06 17:44 ` Martin Hicks

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