From: Andrew Theurer <habanero@us.ibm.com>
To: anton@samba.org, colpatch@us.ibm.com,
"Martin J. Bligh" <mbligh@aracnet.com>,
Dave Hansen <haveblue@us.ibm.com>,
Bill Hartner <bhartner@us.ibm.com>,
Andrew Morton <akpm@zip.com.au>, Robert Love <rml@tech9.net>
Cc: linux-kernel@vger.kernel.org
Subject: [patch] Re: Bug 619 - sched_best_cpu does not pick best cpu (1/1)
Date: Wed, 14 May 2003 20:29:42 -0500 [thread overview]
Message-ID: <200305142029.45413.habanero@us.ibm.com> (raw)
In-Reply-To: <3EB70EEC.9040004@us.ibm.com>
I believe this will work for ppc64:
[root@hearse root]# diffstat patch-nr_cpus_node-ppc64-2.5.69
arch/ppc64/mm/numa.c | 6 +++++-
include/asm-ppc64/mmzone.h | 1 +
include/asm-ppc64/topology.h | 5 +++++
3 files changed, 11 insertions(+), 1 deletion(-)
diff -Naur 2.5.69-bk-5-8-2003-numa/arch/ppc64/mm/numa.c
2.5.69-bk-5-8-2003-numa-nrcpusnode/arch/ppc64/mm/numa.c
--- 2.5.69-bk-5-8-2003-numa/arch/ppc64/mm/numa.c 2003-05-14 18:11:35.000000000
-0700
+++ 2.5.69-bk-5-8-2003-numa-nrcpusnode/arch/ppc64/mm/numa.c 2003-05-14
18:18:06.000000000 -0700
@@ -25,6 +25,7 @@
int numa_memory_lookup_table[MAX_MEMORY >> MEMORY_INCREMENT_SHIFT] =
{ [ 0 ... ((MAX_MEMORY >> MEMORY_INCREMENT_SHIFT) - 1)] = -1};
unsigned long numa_cpumask_lookup_table[MAX_NUMNODES];
+int nr_cpus_in_node[MAX_NUMNODES] = { [0 ... (MAX_NUMNODES -1)] = 0};
struct pglist_data node_data[MAX_NUMNODES];
bootmem_data_t plat_node_bdata[MAX_NUMNODES];
@@ -33,7 +34,10 @@
{
dbg("cpu %d maps to domain %d\n", cpu, node);
numa_cpu_lookup_table[cpu] = node;
- numa_cpumask_lookup_table[node] |= 1UL << cpu;
+ if (!(numa_cpumask_lookup_table[node] & 1UL << cpu)) {
+ numa_cpumask_lookup_table[node] |= 1UL << cpu;
+ nr_cpus_in_node[node]++;
+ }
}
static int __init parse_numa_properties(void)
diff -Naur 2.5.69-bk-5-8-2003-numa/include/asm-ppc64/mmzone.h
2.5.69-bk-5-8-2003-numa-nrcpusnode/include/asm-ppc64/mmzone.h
--- 2.5.69-bk-5-8-2003-numa/include/asm-ppc64/mmzone.h 2003-04-24
14:17:14.000000000 -0700
+++ 2.5.69-bk-5-8-2003-numa-nrcpusnode/include/asm-ppc64/mmzone.h 2003-05-14
18:07:35.000000000 -0700
@@ -21,6 +21,7 @@
extern int numa_cpu_lookup_table[];
extern int numa_memory_lookup_table[];
extern unsigned long numa_cpumask_lookup_table[];
+extern int nr_cpus_in_node[];
#define MAX_MEMORY (1UL << 41)
/* 256MB regions */
diff -Naur 2.5.69-bk-5-8-2003-numa/include/asm-ppc64/topology.h
2.5.69-bk-5-8-2003-numa-nrcpusnode/include/asm-ppc64/topology.h
--- 2.5.69-bk-5-8-2003-numa/include/asm-ppc64/topology.h 2003-05-14
11:03:10.000000000 -0700
+++ 2.5.69-bk-5-8-2003-numa-nrcpusnode/include/asm-ppc64/topology.h 2003-05-14
18:08:38.000000000 -0700
@@ -6,6 +6,11 @@
#ifdef CONFIG_NUMA
+static inline int nr_cpus_node(int node)
+{
+ return nr_cpus_in_node[node];
+}
+
static inline int cpu_to_node(int cpu)
{
int node;
next prev parent reply other threads:[~2003-05-15 1:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-06 1:25 [patch] Re: Bug 619 - sched_best_cpu does not pick best cpu (1/2) Matthew Dobson
2003-05-06 1:28 ` [patch] Re: Bug 619 - sched_best_cpu does not pick best cpu (2/2) Matthew Dobson
2003-05-06 2:09 ` David S. Miller
2003-05-06 11:06 ` Gabriel Paubert
2003-05-15 1:29 ` Andrew Theurer [this message]
2003-05-15 1:26 ` [patch] Re: Bug 619 - sched_best_cpu does not pick best cpu (1/1) Zwane Mwaikambo
2003-05-15 1:48 ` Andrew Theurer
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=200305142029.45413.habanero@us.ibm.com \
--to=habanero@us.ibm.com \
--cc=akpm@zip.com.au \
--cc=anton@samba.org \
--cc=bhartner@us.ibm.com \
--cc=colpatch@us.ibm.com \
--cc=haveblue@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbligh@aracnet.com \
--cc=rml@tech9.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).