* [PATCH] add coherence id for SGI Altix systems
@ 2004-08-13 17:56 Dean Roe
2004-08-13 18:15 ` Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Dean Roe @ 2004-08-13 17:56 UTC (permalink / raw)
To: linux-ia64
Current SGI Altix systems have a NUMAlink domain size of 1024
compute nodes and are fully cache coherent up to 256 compute
nodes (compute nodes are even-numbered). Systems larger than
256 nodes are partitioned into multiple cache coherent systems.
This patch exports a partition's coherence id to users via the
/proc/sgi_sn/coherence_id file.
Signed-off-by: Dean Roe <roe@sgi.com>
Index: bk-work/include/asm-ia64/sn/sn_cpuid.h
=================================--- bk-work.orig/include/asm-ia64/sn/sn_cpuid.h 2004-08-10 14:23:26.000000000 -0500
+++ bk-work/include/asm-ia64/sn/sn_cpuid.h 2004-08-13 11:04:34.000000000 -0500
@@ -4,7 +4,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 2000-2003 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (C) 2000-2004 Silicon Graphics, Inc. All rights reserved.
*/
@@ -93,6 +93,7 @@
*/
#define cpu_physical_id_to_nasid(cpi) ((cpi) &0xfff)
#define cpu_physical_id_to_slice(cpi) ((cpi>>12) & 3)
+#define cpu_physical_id_to_coherence_id(cpi) (cpu_physical_id_to_nasid(cpi) >> 9)
#define get_nasid() ((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xfff)
#define get_slice() ((ia64_getreg(_IA64_REG_CR_LID) >> 28) & 0xf)
#define get_node_number(addr) (((unsigned long)(addr)>>38) & 0x7ff)
@@ -172,6 +173,11 @@
#define smp_physical_node_id() (cpuid_to_nasid(smp_processor_id()))
+/*
+ * cpuid_to_coherence_id - convert a cpuid to the coherence domain id it
+ * resides on
+ */
+#define cpuid_to_coherence_id(cpuid) cpu_physical_id_to_coherence_id(cpu_physical_id(cpuid))
#endif /* _ASM_IA64_SN_SN_CPUID_H */
Index: bk-work/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
=================================--- bk-work.orig/arch/ia64/sn/kernel/sn2/sn_proc_fs.c 2004-08-10 14:23:59.000000000 -0500
+++ bk-work/arch/ia64/sn/kernel/sn2/sn_proc_fs.c 2004-08-13 11:05:06.000000000 -0500
@@ -3,7 +3,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 2000-2003 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (C) 2000-2004 Silicon Graphics, Inc. All rights reserved.
*/
#include <linux/config.h>
#include <asm/uaccess.h>
@@ -118,11 +118,33 @@
}
}
+static int coherence_id_read_proc(char *page, char **start, off_t off,
+ int count, int *eof, void *data) {
+ return sprintf(page, "%d\n", cpuid_to_coherence_id(smp_processor_id()));
+}
+
+void
+register_sn_coherence_id(void) {
+ struct proc_dir_entry *entry;
+
+ if (!sgi_proc_dir) {
+ sgi_proc_dir = proc_mkdir("sgi_sn", 0);
+ }
+ entry = create_proc_entry("coherence_id", 0444, sgi_proc_dir);
+ if (entry) {
+ entry->nlink = 1;
+ entry->data = 0;
+ entry->read_proc = coherence_id_read_proc;
+ entry->write_proc = NULL;
+ }
+}
+
void
register_sn_procfs(void) {
register_sn_partition_id();
register_sn_serial_numbers();
register_sn_force_interrupt();
+ register_sn_coherence_id();
}
#endif /* CONFIG_PROC_FS */
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] add coherence id for SGI Altix systems
2004-08-13 17:56 [PATCH] add coherence id for SGI Altix systems Dean Roe
@ 2004-08-13 18:15 ` Christoph Hellwig
2004-08-13 18:41 ` Russ Anderson
2004-08-13 18:45 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2004-08-13 18:15 UTC (permalink / raw)
To: linux-ia64
On Fri, Aug 13, 2004 at 12:56:32PM -0500, Dean Roe wrote:
> +static int coherence_id_read_proc(char *page, char **start, off_t off,
> + int count, int *eof, void *data) {
The { needs to go on a new line
> + return sprintf(page, "%d\n", cpuid_to_coherence_id(smp_processor_id()));
> +}
please use the seq_file api.
> +void
> +register_sn_coherence_id(void) {
{ pleasement again, and this should be static.
> + struct proc_dir_entry *entry;
> +
> + if (!sgi_proc_dir) {
> + sgi_proc_dir = proc_mkdir("sgi_sn", 0);
> + }
don't SN2 systems have this directory already?
> + entry->nlink = 1;
> + entry->data = 0;
no need to set this two.
> + entry->write_proc = NULL;
dito.
also while you're at it convert the whole file to seq_file and proper
coding style.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] add coherence id for SGI Altix systems
2004-08-13 17:56 [PATCH] add coherence id for SGI Altix systems Dean Roe
2004-08-13 18:15 ` Christoph Hellwig
@ 2004-08-13 18:41 ` Russ Anderson
2004-08-13 18:45 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Russ Anderson @ 2004-08-13 18:41 UTC (permalink / raw)
To: linux-ia64
Christoph Hellwig wrote:
>
> also while you're at it convert the whole file to seq_file and proper
> coding style.
Shouldn't coding style changes be a separate patch? Otherwise
it's hard to tell the real changes from the code style changes.
--
Russ Anderson, OS RAS/Partitioning Project Lead
SGI - Silicon Graphics Inc rja@sgi.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] add coherence id for SGI Altix systems
2004-08-13 17:56 [PATCH] add coherence id for SGI Altix systems Dean Roe
2004-08-13 18:15 ` Christoph Hellwig
2004-08-13 18:41 ` Russ Anderson
@ 2004-08-13 18:45 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2004-08-13 18:45 UTC (permalink / raw)
To: linux-ia64
On Fri, Aug 13, 2004 at 01:41:13PM -0500, Russ Anderson wrote:
> Christoph Hellwig wrote:
> >
> > also while you're at it convert the whole file to seq_file and proper
> > coding style.
>
> Shouldn't coding style changes be a separate patch? Otherwise
> it's hard to tell the real changes from the code style changes.
"while you're at it" wasn't meant as in the same patch, but as a reminder
that additional patches to clean up that area would be very welcome ;-)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-08-13 18:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-13 17:56 [PATCH] add coherence id for SGI Altix systems Dean Roe
2004-08-13 18:15 ` Christoph Hellwig
2004-08-13 18:41 ` Russ Anderson
2004-08-13 18:45 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox