From: "Hong H. Pham" <hong.pham@windriver.com>
To: sparclinux@vger.kernel.org
Subject: Re: [PATCH v2] sparc64: fix and optimize irq distribution
Date: Fri, 22 May 2009 21:55:16 +0000 [thread overview]
Message-ID: <4A171F44.6090608@windriver.com> (raw)
In-Reply-To: <1242233551-3369-1-git-send-email-hong.pham@windriver.com>
[-- Attachment #1: Type: text/plain, Size: 1872 bytes --]
David Miller wrote:
> There is absolutely no connection between virtual cpu numbers
> and the hierarchy in which they sit in the cores and higher
> level hierarchy of the processor. So you can't just say
> (cpu_id / 4) is the core number or anything like that.
>
> You must use the machine description to determine this kind of
> information, just as we do in arch/sparc/kernel/mdesc.c to figure out
> the CPU scheduler grouping maps. (see mark_proc_ids() and
> mark_core_ids())
Thanks for pointing me in this direction. mark_proc_ids() and
mark_core_ids() sets the core_id and proc_id members in the per
cpu __cpu_data. Looks like I can use cpu_data() to figure out
the CPU distribution.
As a side note, here's a dump of cpu_data() on a 2 way T5440.
There's a hole between 48 and 71.
[714162.134215] Brought up 96 CPUs
[714162.135440] CPU 0: node=0 core_id=1 proc_id=0
[714162.135452] CPU 1: node=0 core_id=1 proc_id=0
[714162.135464] CPU 2: node=0 core_id=1 proc_id=0
[714162.135475] CPU 3: node=0 core_id=1 proc_id=0
[714162.135487] CPU 4: node=0 core_id=1 proc_id=1
[714162.135498] CPU 5: node=0 core_id=1 proc_id=1
[714162.135509] CPU 6: node=0 core_id=1 proc_id=1
[714162.135521] CPU 7: node=0 core_id=1 proc_id=1
[714162.135532] CPU 8: node=0 core_id=2 proc_id=2
[714162.135544] CPU 9: node=0 core_id=2 proc_id=2
[714162.135555] CPU 10: node=0 core_id=2 proc_id=2
...
[714162.135961] CPU 45: node=0 core_id=6 proc_id=11
[714162.135973] CPU 46: node=0 core_id=6 proc_id=11
[714162.135984] CPU 47: node=0 core_id=6 proc_id=11
[714162.135996] CPU 72: node=1 core_id=7 proc_id=12
[714162.136008] CPU 73: node=1 core_id=7 proc_id=12
[714162.136019] CPU 74: node=1 core_id=7 proc_id=12
[714162.136031] CPU 75: node=1 core_id=7 proc_id=12
[714162.136043] CPU 76: node=1 core_id=7 proc_id=13
...
[714162.136554] CPU 119: node=1 core_id=12 proc_id=23
Regards,
Hong
[-- Attachment #2: dump_cpu_data.patch --]
[-- Type: text/x-patch, Size: 575 bytes --]
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index 54906aa..7fa909f 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1353,8 +1353,20 @@ void __cpu_die(unsigned int cpu)
}
#endif
+static void dump_cpu_data(void)
+{
+ int i;
+
+ for_each_online_cpu(i) {
+ printk(KERN_DEBUG "CPU %i: node=%i core_id=%i proc_id=%i\n",
+ i, cpu_to_node(i),
+ cpu_data(i).core_id, cpu_data(i).proc_id);
+ }
+}
+
void __init smp_cpus_done(unsigned int max_cpus)
{
+ dump_cpu_data();
}
void smp_send_reschedule(int cpu)
next prev parent reply other threads:[~2009-05-22 21:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-13 16:52 [PATCH v2] sparc64: fix and optimize irq distribution Hong H. Pham
2009-05-22 0:14 ` David Miller
2009-05-22 0:18 ` David Miller
2009-05-22 21:55 ` Hong H. Pham [this message]
2009-05-23 0:21 ` David Miller
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=4A171F44.6090608@windriver.com \
--to=hong.pham@windriver.com \
--cc=sparclinux@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.