From: Jack Steiner <steiner@sgi.com>
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Externalize SLIT table
Date: Tue, 23 Nov 2004 11:32:09 -0600 [thread overview]
Message-ID: <20041123173208.GA13177@sgi.com> (raw)
In-Reply-To: <p73k6sz7am2.fsf@verdi.suse.de>
(Sorry for the delay in posting this. Our mail server was
dropping mail ....)
Here is an update patch to externalize the SLIT information. I think I have
encorporated all the comments that were posted previously)
For example:
# cd /sys/devices/system
# find .
./node
./node/node5
./node/node5/distance
./node/node5/numastat
./node/node5/meminfo
./node/node5/cpumap
# cat ./node/node0/distance
10 20 64 42 42 22
# cat node/*/distance
10 20 64 42 42 22
20 10 42 22 64 84
64 42 10 20 22 42
42 22 20 10 42 62
42 64 22 42 10 20
22 84 42 62 20 10
Does this look ok???
Signed-off-by: Jack Steiner <steiner@sgi.com>
Add SLIT (inter node distance) information to sysfs.
Index: linux/drivers/base/node.c
===================================================================
--- linux.orig/drivers/base/node.c 2004-11-05 08:34:42.461312000 -0600
+++ linux/drivers/base/node.c 2004-11-05 15:56:23.345662000 -0600
@@ -111,6 +111,24 @@ static ssize_t node_read_numastat(struct
}
static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL);
+static ssize_t node_read_distance(struct sys_device * dev, char * buf)
+{
+ int nid = dev->id;
+ int len = 0;
+ int i;
+
+ /* buf currently PAGE_SIZE, need ~4 chars per node */
+ BUILD_BUG_ON(NR_NODES*4 > PAGE_SIZE/2);
+
+ for (i = 0; i < numnodes; i++)
+ len += sprintf(buf + len, "%s%d", i ? " " : "", node_distance(nid, i));
+
+ len += sprintf(buf + len, "\n");
+ return len;
+}
+static SYSDEV_ATTR(distance, S_IRUGO, node_read_distance, NULL);
+
+
/*
* register_node - Setup a driverfs device for a node.
* @num - Node number to use when creating the device.
@@ -129,6 +147,7 @@ int __init register_node(struct node *no
sysdev_create_file(&node->sysdev, &attr_cpumap);
sysdev_create_file(&node->sysdev, &attr_meminfo);
sysdev_create_file(&node->sysdev, &attr_numastat);
+ sysdev_create_file(&node->sysdev, &attr_distance);
}
return error;
}
Index: linux/include/asm-i386/topology.h
===================================================================
--- linux.orig/include/asm-i386/topology.h 2004-11-05 08:34:53.713053000 -0600
+++ linux/include/asm-i386/topology.h 2004-11-23 09:59:43.574062951 -0600
@@ -66,9 +66,6 @@ static inline cpumask_t pcibus_to_cpumas
return node_to_cpumask(mp_bus_id_to_node[bus]);
}
-/* Node-to-Node distance */
-#define node_distance(from, to) ((from) != (to))
-
/* sched_domains SD_NODE_INIT for NUMAQ machines */
#define SD_NODE_INIT (struct sched_domain) { \
.span = CPU_MASK_NONE, \
Index: linux/include/linux/topology.h
===================================================================
--- linux.orig/include/linux/topology.h 2004-11-05 08:34:57.492932000 -0600
+++ linux/include/linux/topology.h 2004-11-23 10:03:26.700821978 -0600
@@ -55,7 +55,10 @@ static inline int __next_node_with_cpus(
for (node = 0; node < numnodes; node = __next_node_with_cpus(node))
#ifndef node_distance
-#define node_distance(from,to) ((from) != (to))
+/* Conform to ACPI 2.0 SLIT distance definitions */
+#define LOCAL_DISTANCE 10
+#define REMOTE_DISTANCE 20
+#define node_distance(from,to) ((from) == (to) ? LOCAL_DISTANCE : REMOTE_DISTANCE)
#endif
#ifndef PENALTY_FOR_NODE_WITH_CPUS
#define PENALTY_FOR_NODE_WITH_CPUS (1)
--
Thanks
Jack Steiner (steiner@sgi.com) 651-683-5302
Principal Engineer SGI - Silicon Graphics, Inc.
next prev parent reply other threads:[~2004-11-23 17:51 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20041103205655.GA5084@sgi.com.suse.lists.linux.kernel>
[not found] ` <20041104.105908.18574694.t-kochi@bq.jp.nec.com.suse.lists.linux.kernel>
[not found] ` <20041104040713.GC21211@wotan.suse.de.suse.lists.linux.kernel>
[not found] ` <20041104.135721.08317994.t-kochi@bq.jp.nec.com.suse.lists.linux.kernel>
[not found] ` <20041105160808.GA26719@sgi.com.suse.lists.linux.kernel>
2004-11-06 6:30 ` Externalize SLIT table Andi Kleen
2004-11-23 17:32 ` Jack Steiner [this message]
2004-11-23 19:06 ` Andi Kleen
2004-11-03 20:56 Jack Steiner
2004-11-04 1:59 ` Takayoshi Kochi
2004-11-04 1:59 ` Takayoshi Kochi
2004-11-04 4:07 ` Andi Kleen
2004-11-04 4:07 ` Andi Kleen
2004-11-04 4:57 ` Takayoshi Kochi
2004-11-04 4:57 ` Takayoshi Kochi
2004-11-04 6:37 ` Andi Kleen
2004-11-04 6:37 ` Andi Kleen
2004-11-05 16:08 ` Jack Steiner
2004-11-05 16:08 ` Jack Steiner
2004-11-05 16:26 ` Andreas Schwab
2004-11-05 16:26 ` Andreas Schwab
2004-11-05 16:44 ` Jack Steiner
2004-11-05 16:44 ` Jack Steiner
2004-11-06 11:50 ` Christoph Hellwig
2004-11-06 11:50 ` Christoph Hellwig
2004-11-06 12:48 ` Andi Kleen
2004-11-06 12:48 ` Andi Kleen
2004-11-06 13:07 ` Christoph Hellwig
2004-11-06 13:07 ` Christoph Hellwig
2004-11-05 17:13 ` Erich Focht
2004-11-05 17:13 ` Erich Focht
2004-11-05 19:13 ` Jack Steiner
2004-11-05 19:13 ` Jack Steiner
2004-11-09 19:23 ` Matthew Dobson
2004-11-09 19:23 ` Matthew Dobson
2004-11-04 14:13 ` Jack Steiner
2004-11-04 14:13 ` Jack Steiner
2004-11-04 14:29 ` Andi Kleen
2004-11-04 14:29 ` Andi Kleen
2004-11-04 15:31 ` Erich Focht
2004-11-04 15:31 ` Erich Focht
2004-11-04 17:04 ` Andi Kleen
2004-11-04 17:04 ` Andi Kleen
2004-11-04 19:36 ` Jack Steiner
2004-11-04 19:36 ` Jack Steiner
2004-11-09 19:45 ` Matthew Dobson
2004-11-09 19:45 ` Matthew Dobson
2004-11-09 19:43 ` Matthew Dobson
2004-11-09 19:43 ` Matthew Dobson
2004-11-09 20:34 ` Mark Goodwin
2004-11-09 20:34 ` Mark Goodwin
2004-11-09 22:00 ` Jesse Barnes
2004-11-09 22:00 ` Jesse Barnes
2004-11-09 23:58 ` Matthew Dobson
2004-11-09 23:58 ` Matthew Dobson
2004-11-10 5:05 ` Mark Goodwin
2004-11-10 5:05 ` Mark Goodwin
2004-11-10 18:45 ` Erich Focht
2004-11-10 18:45 ` Erich Focht
2004-11-10 22:09 ` Matthew Dobson
2004-11-10 22:09 ` Matthew Dobson
2004-11-18 16:39 ` Jack Steiner
2004-11-18 16:39 ` Jack Steiner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041123173208.GA13177@sgi.com \
--to=steiner@sgi.com \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.