linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: x86-64 dual core mapping
@ 2005-04-28 19:49 YhLu
  2005-04-30  0:56 ` Siddha, Suresh B
  0 siblings, 1 reply; 13+ messages in thread
From: YhLu @ 2005-04-28 19:49 UTC (permalink / raw)
  To: YhLu, Andi Kleen; +Cc: linux-kernel

Please refer to my patch about that.

YH

before patch
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 0(2) -> Node 0 -> Core 0
Booting processor 1/1 rip 6000 rsp ffff81007ff99f58
Initializing CPU#1
masked ExtINT on CPU#1
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 1(2) -> Node 0 -> Core 0
 stepping 00
Synced TSC of CPU 1 difference 21474835384
Booting processor 2/2 rip 6000 rsp ffff81013ffa3f58
Initializing CPU#2
masked ExtINT on CPU#2
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 2(2) -> Node 1 -> Core 1
 stepping 00
Synced TSC of CPU 2 difference 21474835425
Booting processor 3/3 rip 6000 rsp ffff81007ff49f58
Initializing CPU#3
masked ExtINT on CPU#3
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 3(2) -> Node 1 -> Core 1
 stepping 00
Synced TSC of CPU 3 difference 21474835425
Brought up 4 CPUs


~ # cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 255
siblings        : 2
core id         : 0
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 3956.73
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 255
siblings        : 2
core id         : 0
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 4014.08
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

processor       : 2
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 255
siblings        : 2
core id         : 1
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 4014.08
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

processor       : 3
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 255
siblings        : 2
core id         : 1
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 4014.08
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

~ # 



after patch


CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 0(2) -> Node 0 -> Core 0
Booting processor 1/1 rip 6000 rsp ffff81007ff99f58
Initializing CPU#1
masked ExtINT on CPU#1
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 1(2) -> Node 0 -> Core 1
 stepping 00
Synced TSC of CPU 1 difference 21474835384
Booting processor 2/2 rip 6000 rsp ffff81013ffa3f58
Initializing CPU#2
masked ExtINT on CPU#2
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 2(2) -> Node 1 -> Core 0
 stepping 00
Synced TSC of CPU 2 difference 21474835425
Booting processor 3/3 rip 6000 rsp ffff81007ff49f58
Initializing CPU#3
masked ExtINT on CPU#3
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 3(2) -> Node 1 -> Core 1
 stepping 00
Synced TSC of CPU 3 difference 21474835425
Brought up 4 CPUs


~ # cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 3956.73
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 4014.08
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

processor       : 2
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 1
siblings        : 2
core id         : 0
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 4014.08
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

processor       : 3
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 1
siblings        : 2
core id         : 1
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 4014.08
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

~ # 







amd_dual_core_id.diff


--- setup.o.c   2005-04-28 12:41:12.823456408 -0700
+++ setup.c     2005-04-28 13:11:04.187127736 -0700
@@ -731,19 +731,20 @@
        int node = 0;
        if (c->x86_num_cores == 1)
                return;
-       cpu_core_id[cpu] = cpu >> hweight32(c->x86_num_cores - 1);
+       cpu_core_id[cpu] = cpu%c->x86_num_cores;

 #ifdef CONFIG_NUMA
        /* When an ACPI SRAT table is available use the mappings from SRAT
           instead. */
        if (acpi_numa <= 0) {
-               node = cpu_core_id[cpu];
+               node = cpu >> hweight32(c->x86_num_cores - 1);
                if (!node_online(node))
                        node = first_node(node_online_map);
                cpu_to_node[cpu] = node;
        } else {
                node = cpu_to_node[cpu];
        }
+       phys_proc_id[cpu] = node;
 #endif
        printk(KERN_INFO "CPU %d(%d) -> Node %d -> Core %d\n",
                        cpu, c->x86_num_cores, node, cpu_core_id[cpu]);
--- smpboot.o.c 2005-04-28 13:00:03.611550488 -0700
+++ smpboot.c   2005-04-28 12:59:27.151093320 -0700
@@ -652,7 +652,7 @@
                int i;
                if (smp_num_siblings > 1) {
                        for_each_online_cpu (i) {
-                               if (cpu_core_id[cpu] == cpu_core_id[i]) {
+                               if (cpu_to_node[cpu] == cpu_to_node[i]) {
                                        siblings++;
                                        cpu_set(i, cpu_sibling_map[cpu]);
                                }

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

* Re: x86-64 dual core mapping
  2005-04-28 19:49 x86-64 dual core mapping YhLu
@ 2005-04-30  0:56 ` Siddha, Suresh B
  0 siblings, 0 replies; 13+ messages in thread
From: Siddha, Suresh B @ 2005-04-30  0:56 UTC (permalink / raw)
  To: YhLu; +Cc: Andi Kleen, linux-kernel

On Thu, Apr 28, 2005 at 12:49:42PM -0700, YhLu wrote:
> Please refer to my patch about that.
> 
> --- smpboot.o.c 2005-04-28 13:00:03.611550488 -0700
> +++ smpboot.c   2005-04-28 12:59:27.151093320 -0700
> @@ -652,7 +652,7 @@
>                 int i;
>                 if (smp_num_siblings > 1) {
>                         for_each_online_cpu (i) {
> -                               if (cpu_core_id[cpu] == cpu_core_id[i]) {
> +                               if (cpu_to_node[cpu] == cpu_to_node[i]) {
>                                         siblings++;
>                                         cpu_set(i, cpu_sibling_map[cpu]);
>                                 }

This patch is wrong. It will break Intel systems and I think it is also not 
the correct fix for the systems you are trying to fix.

Please don't do this.

thanks,
suresh

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

* RE: x86-64 dual core mapping
@ 2005-05-09 21:24 YhLu
  0 siblings, 0 replies; 13+ messages in thread
From: YhLu @ 2005-05-09 21:24 UTC (permalink / raw)
  To: YhLu, Andi Kleen; +Cc: linux-kernel

Andi,

the dual core mapping in 2.6.12-rc4 is not right yet. you may need to try
"acpi=off"

YH 

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

* Re: x86-64 dual core mapping
  2005-05-04  0:18 YhLu
@ 2005-05-04 13:18 ` Andi Kleen
  0 siblings, 0 replies; 13+ messages in thread
From: Andi Kleen @ 2005-05-04 13:18 UTC (permalink / raw)
  To: YhLu; +Cc: Andi Kleen, linux-kernel

On Tue, May 03, 2005 at 05:18:15PM -0700, YhLu wrote:
> Andi,
> 
> Did you try "acpi=off" on you test?

numa=noacpi yes which is equivalent.

Please wait until after the tree resync with this.

-Andi

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

* RE: x86-64 dual core mapping
@ 2005-05-04  0:18 YhLu
  2005-05-04 13:18 ` Andi Kleen
  0 siblings, 1 reply; 13+ messages in thread
From: YhLu @ 2005-05-04  0:18 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

Andi,

Did you try "acpi=off" on you test?

YH 

> -----Original Message-----
> From: Andi Kleen [mailto:ak@suse.de] 
> Sent: Tuesday, May 03, 2005 7:25 AM
> To: YhLu
> Cc: Andi Kleen; linux-kernel@vger.kernel.org
> Subject: Re: x86-64 dual core mapping
> 
> On Mon, May 02, 2005 at 02:01:00PM -0700, YhLu wrote:
> > Andi,
> > 
> > resent. FYI
> 
> I retested with my tree and everything works for me as expected.
> Well actually there is a problem with the core mappings, but 
> not on dual core, but on single core (more cosmetic than real)
> 
> It is possible that some patch is missing again in mainline.
> I will sync up my patchkit next week and double check then 
> that mainline is in the same state as mine.
> 
> -Andi
> 

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

* RE: x86-64 dual core mapping
@ 2005-05-03 23:35 YhLu
  0 siblings, 0 replies; 13+ messages in thread
From: YhLu @ 2005-05-03 23:35 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

Thanks. 

For dual core cpu, if the BIOS or LinuxBIOS disable the dual core, the
kernel will treat core0 of node 1 as core 1 of node 0.....

YH


> -----Original Message-----
> From: Andi Kleen [mailto:ak@suse.de] 
> Sent: Tuesday, May 03, 2005 7:25 AM
> To: YhLu
> Cc: Andi Kleen; linux-kernel@vger.kernel.org
> Subject: Re: x86-64 dual core mapping
> 
> On Mon, May 02, 2005 at 02:01:00PM -0700, YhLu wrote:
> > Andi,
> > 
> > resent. FYI
> 
> I retested with my tree and everything works for me as expected.
> Well actually there is a problem with the core mappings, but 
> not on dual core, but on single core (more cosmetic than real)
> 
> It is possible that some patch is missing again in mainline.
> I will sync up my patchkit next week and double check then 
> that mainline is in the same state as mine.
> 
> -Andi
> 

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

* Re: x86-64 dual core mapping
  2005-05-02 21:01 YhLu
@ 2005-05-03 14:25 ` Andi Kleen
  0 siblings, 0 replies; 13+ messages in thread
From: Andi Kleen @ 2005-05-03 14:25 UTC (permalink / raw)
  To: YhLu; +Cc: Andi Kleen, linux-kernel

On Mon, May 02, 2005 at 02:01:00PM -0700, YhLu wrote:
> Andi,
> 
> resent. FYI

I retested with my tree and everything works for me as expected.
Well actually there is a problem with the core mappings,
but not on dual core, but on single core (more cosmetic than real)

It is possible that some patch is missing again in mainline.
I will sync up my patchkit next week and double check then
that mainline is in the same state as mine.

-Andi

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

* RE: x86-64 dual core mapping
@ 2005-05-02 21:01 YhLu
  2005-05-03 14:25 ` Andi Kleen
  0 siblings, 1 reply; 13+ messages in thread
From: YhLu @ 2005-05-02 21:01 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

Andi,

resent. FYI

YH

before patch
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 0(2) -> Node 0 -> Core 0
Booting processor 1/1 rip 6000 rsp ffff81007ff99f58 Initializing CPU#1
masked ExtINT on CPU#1
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 1(2) -> Node 0 -> Core 0
 stepping 00
Synced TSC of CPU 1 difference 21474835384 Booting processor 2/2 rip 6000
rsp ffff81013ffa3f58 Initializing CPU#2 masked ExtINT on CPU#2
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 2(2) -> Node 1 -> Core 1
 stepping 00
Synced TSC of CPU 2 difference 21474835425 Booting processor 3/3 rip 6000
rsp ffff81007ff49f58 Initializing CPU#3 masked ExtINT on CPU#3
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 3(2) -> Node 1 -> Core 1
 stepping 00
Synced TSC of CPU 3 difference 21474835425 Brought up 4 CPUs


~ # cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 255
siblings        : 2
core id         : 0
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 3956.73
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 255
siblings        : 2
core id         : 0
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 4014.08
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

processor       : 2
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 255
siblings        : 2
core id         : 1
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 4014.08
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

processor       : 3
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 255
siblings        : 2
core id         : 1
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 4014.08
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

~ # 



after patch


CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 0(2) -> Node 0 -> Core 0
Booting processor 1/1 rip 6000 rsp ffff81007ff99f58 Initializing CPU#1
masked ExtINT on CPU#1
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 1(2) -> Node 0 -> Core 1
 stepping 00
Synced TSC of CPU 1 difference 21474835384 Booting processor 2/2 rip 6000
rsp ffff81013ffa3f58 Initializing CPU#2 masked ExtINT on CPU#2
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 2(2) -> Node 1 -> Core 0
 stepping 00
Synced TSC of CPU 2 difference 21474835425 Booting processor 3/3 rip 6000
rsp ffff81007ff49f58 Initializing CPU#3 masked ExtINT on CPU#3
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 3(2) -> Node 1 -> Core 1
 stepping 00
Synced TSC of CPU 3 difference 21474835425 Brought up 4 CPUs


~ # cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 3956.73
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 4014.08
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

processor       : 2
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 1
siblings        : 2
core id         : 0
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 4014.08
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

processor       : 3
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 33
model name      : unknown
stepping        : 0
cpu MHz         : 2010.342
cache size      : 1024 KB
physical id     : 1
siblings        : 2
core id         : 1
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 ht pni syscall y
bogomips        : 4014.08
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

~ #  

> -----Original Message-----
> From: Andi Kleen [mailto:ak@suse.de] 
> Sent: Monday, May 02, 2005 1:19 PM
> To: YhLu
> Cc: Andi Kleen; linux-kernel@vger.kernel.org
> Subject: Re: x86-64 dual core mapping
> 
> On Mon, May 02, 2005 at 12:41:31PM -0700, YhLu wrote:
> > I'm using LinuxBIOS and there is no acpi in that. Also I have tried 
> > Normal BIOS, it also produce that.
> > 
> > Did you check my patch? It fixed that.
> 
> I dont think it is a correct, and Suresh is right that it 
> will break Intel setups.
> 
> I will investigate this evening and see if I can reproduce it 
> on Simnow.
> 
> -Andi
> 

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

* Re: x86-64 dual core mapping
  2005-05-02 19:41 YhLu
@ 2005-05-02 20:18 ` Andi Kleen
  0 siblings, 0 replies; 13+ messages in thread
From: Andi Kleen @ 2005-05-02 20:18 UTC (permalink / raw)
  To: YhLu; +Cc: Andi Kleen, linux-kernel

On Mon, May 02, 2005 at 12:41:31PM -0700, YhLu wrote:
> I'm using LinuxBIOS and there is no acpi in that. Also I have tried Normal
> BIOS, it also produce that.
> 
> Did you check my patch? It fixed that.

I dont think it is a correct, and Suresh is right that it 
will break Intel setups.

I will investigate this evening and see if I can reproduce it
on Simnow.

-Andi

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

* RE: x86-64 dual core mapping
@ 2005-05-02 19:41 YhLu
  2005-05-02 20:18 ` Andi Kleen
  0 siblings, 1 reply; 13+ messages in thread
From: YhLu @ 2005-05-02 19:41 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

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

I'm using LinuxBIOS and there is no acpi in that. Also I have tried Normal
BIOS, it also produce that.

Did you check my patch? It fixed that.

regards

YH 

> -----Original Message-----
> From: Andi Kleen [mailto:ak@suse.de] 
> Sent: Monday, May 02, 2005 10:02 AM
> To: YhLu
> Cc: Andi Kleen; linux-kernel@vger.kernel.org
> Subject: Re: x86-64 dual core mapping
> 
> On Thu, Apr 21, 2005 at 07:38:07PM -0700, YhLu wrote:
> > Andi,
> > 
> > I tried 2.6.12-rc3 with dual way dual cpus.
> > 
> > It seems right mapping should be
> > CPU 0(2) -> Node 0 -> Core 0
> > CPU 1(2) -> Node 0 -> Core 1
> > CPU 2(2) -> Node 1 -> Core 0
> > CPU 3(2) -> Node 1 -> Core 1
> > 
> > instead of
> > 
> > CPU 0(2) -> Node 0 -> Core 0
> > CPU 1(2) -> Node 0 -> Core 0
> > CPU 2(2) -> Node 1 -> Core 1
> > CPU 3(2) -> Node 1 -> Core 1
> 
> Hmm, yes, something seems wrong. The last time I tested it 
> worked this way, but maybe the latest merge has broken it 
> again. I will check it later.
> 
> Are you sure you dont have a broken SRAT table? The SRAT 
> table will overwrite the mappings, so if it is wrong the one 
> Linux reports will be too.
> 
> -Andi
> > 
> > YH
> > 
> > 
> > 
> > 
> > CPU 0(2) -> Node 0 -> Core 0
> > Using local APIC NMI watchdog using perfctr0 enabled ExtINT 
> on CPU#0 
> > ENABLING IO-APIC IRQs Using IO-APIC 4 ...changing IO-APIC physical 
> > APIC ID to 4 ... ok.
> > Using IO-APIC 5
> > ...changing IO-APIC physical APIC ID to 5 ... ok.
> > Using IO-APIC 6
> > ...changing IO-APIC physical APIC ID to 6 ... ok.
> > Using IO-APIC 7
> > ...changing IO-APIC physical APIC ID to 7 ... ok.
> > Synchronizing Arb IDs.
> > ..TIMER: vector=0x31 pin1=0 pin2=2
> > testing the IO APIC.......................
> > 
> > 
> > 
> > 
> > .................................... done.
> > Using local APIC timer interrupts.
> > Detected 12.564 MHz APIC timer.
> > Booting processor 1/1 rip 6000 rsp ffff81007ff99f58 
> Initializing CPU#1 
> > masked ExtINT on CPU#1
> > CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
> > CPU: L2 Cache: 1024K (64 bytes/line)
> > CPU 1(2) -> Node 0 -> Core 0
> >  stepping 00
> > Synced TSC of CPU 1 difference 30064769976 Booting 
> processor 2/2 rip 
> > 6000 rsp ffff81013ffa3f58 Initializing CPU#2 masked ExtINT on CPU#2
> > CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
> > CPU: L2 Cache: 1024K (64 bytes/line)
> > CPU 2(2) -> Node 1 -> Core 1
> >  stepping 00
> > Synced TSC of CPU 2 difference 30064770021 Booting 
> processor 3/3 rip 
> > 6000 rsp ffff81007ff49f58 Initializing CPU#3 masked ExtINT on CPU#3
> > CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
> > CPU: L2 Cache: 1024K (64 bytes/line)
> > CPU 3(2) -> Node 1 -> Core 1
> >  stepping 00
> > Synced TSC of CPU 3 difference 30064770021 Brought up 4 CPUs
> 


[-- Attachment #2: amd_dual_core_id.diff --]
[-- Type: application/octet-stream, Size: 1162 bytes --]

--- setup.o.c	2005-04-28 12:41:12.823456408 -0700
+++ setup.c	2005-04-28 13:11:04.187127736 -0700
@@ -731,19 +731,20 @@
 	int node = 0;
 	if (c->x86_num_cores == 1)
 		return;
-	cpu_core_id[cpu] = cpu >> hweight32(c->x86_num_cores - 1);
+	cpu_core_id[cpu] = cpu%c->x86_num_cores;
 
 #ifdef CONFIG_NUMA
 	/* When an ACPI SRAT table is available use the mappings from SRAT
  	   instead. */
 	if (acpi_numa <= 0) {
-		node = cpu_core_id[cpu];
+		node = cpu >> hweight32(c->x86_num_cores - 1);
 		if (!node_online(node))
 			node = first_node(node_online_map);
 		cpu_to_node[cpu] = node;
 	} else {
 		node = cpu_to_node[cpu];
 	}
+	phys_proc_id[cpu] = node;
 #endif
 	printk(KERN_INFO "CPU %d(%d) -> Node %d -> Core %d\n",
 			cpu, c->x86_num_cores, node, cpu_core_id[cpu]);
--- smpboot.o.c	2005-04-28 13:00:03.611550488 -0700
+++ smpboot.c	2005-04-28 12:59:27.151093320 -0700
@@ -652,7 +652,7 @@
 		int i;
 		if (smp_num_siblings > 1) {
 			for_each_online_cpu (i) {
-				if (cpu_core_id[cpu] == cpu_core_id[i]) {
+				if (cpu_to_node[cpu] == cpu_to_node[i]) {
 					siblings++;
 					cpu_set(i, cpu_sibling_map[cpu]);
 				}

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

* Re: x86-64 dual core mapping
  2005-04-22  2:38 YhLu
@ 2005-05-02 17:02 ` Andi Kleen
  0 siblings, 0 replies; 13+ messages in thread
From: Andi Kleen @ 2005-05-02 17:02 UTC (permalink / raw)
  To: YhLu; +Cc: Andi Kleen, linux-kernel

On Thu, Apr 21, 2005 at 07:38:07PM -0700, YhLu wrote:
> Andi,
> 
> I tried 2.6.12-rc3 with dual way dual cpus.
> 
> It seems right mapping should be
> CPU 0(2) -> Node 0 -> Core 0
> CPU 1(2) -> Node 0 -> Core 1
> CPU 2(2) -> Node 1 -> Core 0
> CPU 3(2) -> Node 1 -> Core 1
> 
> instead of
> 
> CPU 0(2) -> Node 0 -> Core 0
> CPU 1(2) -> Node 0 -> Core 0
> CPU 2(2) -> Node 1 -> Core 1
> CPU 3(2) -> Node 1 -> Core 1

Hmm, yes, something seems wrong. The last time I tested 
it worked this way, but maybe the latest merge has broken 
it again. I will check it later.

Are you sure you dont have a broken SRAT table? The SRAT
table will overwrite the mappings, so if it is wrong
the one Linux reports will be too.

-Andi
> 
> YH
> 
> 
> 
> 
> CPU 0(2) -> Node 0 -> Core 0
> Using local APIC NMI watchdog using perfctr0
> enabled ExtINT on CPU#0
> ENABLING IO-APIC IRQs
> Using IO-APIC 4
> ...changing IO-APIC physical APIC ID to 4 ... ok.
> Using IO-APIC 5
> ...changing IO-APIC physical APIC ID to 5 ... ok.
> Using IO-APIC 6
> ...changing IO-APIC physical APIC ID to 6 ... ok.
> Using IO-APIC 7
> ...changing IO-APIC physical APIC ID to 7 ... ok.
> Synchronizing Arb IDs.
> ..TIMER: vector=0x31 pin1=0 pin2=2
> testing the IO APIC.......................
> 
> 
> 
> 
> .................................... done.
> Using local APIC timer interrupts.
> Detected 12.564 MHz APIC timer.
> Booting processor 1/1 rip 6000 rsp ffff81007ff99f58
> Initializing CPU#1
> masked ExtINT on CPU#1
> CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
> CPU: L2 Cache: 1024K (64 bytes/line)
> CPU 1(2) -> Node 0 -> Core 0
>  stepping 00
> Synced TSC of CPU 1 difference 30064769976
> Booting processor 2/2 rip 6000 rsp ffff81013ffa3f58
> Initializing CPU#2
> masked ExtINT on CPU#2
> CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
> CPU: L2 Cache: 1024K (64 bytes/line)
> CPU 2(2) -> Node 1 -> Core 1
>  stepping 00
> Synced TSC of CPU 2 difference 30064770021
> Booting processor 3/3 rip 6000 rsp ffff81007ff49f58
> Initializing CPU#3
> masked ExtINT on CPU#3
> CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
> CPU: L2 Cache: 1024K (64 bytes/line)
> CPU 3(2) -> Node 1 -> Core 1
>  stepping 00
> Synced TSC of CPU 3 difference 30064770021
> Brought up 4 CPUs

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

* RE: x86-64 dual core mapping
@ 2005-04-28 18:55 YhLu
  0 siblings, 0 replies; 13+ messages in thread
From: YhLu @ 2005-04-28 18:55 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

 Andi,

accoring to the code in arch/x86_64/setup.c

        /* When an ACPI SRAT table is available use the mappings from SRAT
           instead. */
        if (acpi_numa <= 0) {
                node = cpu_core_id[cpu];
                if (!node_online(node))
                        node = first_node(node_online_map);
                cpu_to_node[cpu] = node;
        } else {
                node = cpu_to_node[cpu];
        }


cpu_to_node[cpu] == cpu_core_id[cpu]

So you mean core id is node id?

YH

> -----Original Message-----
> From: YhLu 
> Sent: Thursday, April 21, 2005 7:19 PM
> To: 'Andi Kleen'
> Cc: linux-kernel@vger.kernel.org
> Subject: x86-64 dual core mapping
> 
> Andi,
> 
> I tried 2.6.12-rc3 with dual way dual cpus.
> 
> It seems right mapping should be
> CPU 0(2) -> Node 0 -> Core 0
> CPU 1(2) -> Node 0 -> Core 1
> CPU 2(2) -> Node 1 -> Core 0
> CPU 3(2) -> Node 1 -> Core 1
> 
> instead of
> 
> CPU 0(2) -> Node 0 -> Core 0
> CPU 1(2) -> Node 0 -> Core 0
> CPU 2(2) -> Node 1 -> Core 1
> CPU 3(2) -> Node 1 -> Core 1
> 
> YH
> 
> 
> 
> 
> CPU 0(2) -> Node 0 -> Core 0
> Using local APIC NMI watchdog using perfctr0 enabled ExtINT 
> on CPU#0 ENABLING IO-APIC IRQs Using IO-APIC 4 ...changing 
> IO-APIC physical APIC ID to 4 ... ok.
> Using IO-APIC 5
> ...changing IO-APIC physical APIC ID to 5 ... ok.
> Using IO-APIC 6
> ...changing IO-APIC physical APIC ID to 6 ... ok.
> Using IO-APIC 7
> ...changing IO-APIC physical APIC ID to 7 ... ok.
> Synchronizing Arb IDs.
> ..TIMER: vector=0x31 pin1=0 pin2=2
> testing the IO APIC.......................
> 
> 
> 
> 
> .................................... done.
> Using local APIC timer interrupts.
> Detected 12.564 MHz APIC timer.
> Booting processor 1/1 rip 6000 rsp ffff81007ff99f58 
> Initializing CPU#1 masked ExtINT on CPU#1
> CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
> CPU: L2 Cache: 1024K (64 bytes/line)
> CPU 1(2) -> Node 0 -> Core 0
>  stepping 00
> Synced TSC of CPU 1 difference 30064769976 Booting processor 
> 2/2 rip 6000 rsp ffff81013ffa3f58 Initializing CPU#2 masked 
> ExtINT on CPU#2
> CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
> CPU: L2 Cache: 1024K (64 bytes/line)
> CPU 2(2) -> Node 1 -> Core 1
>  stepping 00
> Synced TSC of CPU 2 difference 30064770021 Booting processor 
> 3/3 rip 6000 rsp ffff81007ff49f58 Initializing CPU#3 masked 
> ExtINT on CPU#3
> CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
> CPU: L2 Cache: 1024K (64 bytes/line)
> CPU 3(2) -> Node 1 -> Core 1
>  stepping 00
> Synced TSC of CPU 3 difference 30064770021 Brought up 4 CPUs

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

* x86-64 dual core mapping
@ 2005-04-22  2:38 YhLu
  2005-05-02 17:02 ` Andi Kleen
  0 siblings, 1 reply; 13+ messages in thread
From: YhLu @ 2005-04-22  2:38 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

Andi,

I tried 2.6.12-rc3 with dual way dual cpus.

It seems right mapping should be
CPU 0(2) -> Node 0 -> Core 0
CPU 1(2) -> Node 0 -> Core 1
CPU 2(2) -> Node 1 -> Core 0
CPU 3(2) -> Node 1 -> Core 1

instead of

CPU 0(2) -> Node 0 -> Core 0
CPU 1(2) -> Node 0 -> Core 0
CPU 2(2) -> Node 1 -> Core 1
CPU 3(2) -> Node 1 -> Core 1

YH




CPU 0(2) -> Node 0 -> Core 0
Using local APIC NMI watchdog using perfctr0
enabled ExtINT on CPU#0
ENABLING IO-APIC IRQs
Using IO-APIC 4
...changing IO-APIC physical APIC ID to 4 ... ok.
Using IO-APIC 5
...changing IO-APIC physical APIC ID to 5 ... ok.
Using IO-APIC 6
...changing IO-APIC physical APIC ID to 6 ... ok.
Using IO-APIC 7
...changing IO-APIC physical APIC ID to 7 ... ok.
Synchronizing Arb IDs.
..TIMER: vector=0x31 pin1=0 pin2=2
testing the IO APIC.......................




.................................... done.
Using local APIC timer interrupts.
Detected 12.564 MHz APIC timer.
Booting processor 1/1 rip 6000 rsp ffff81007ff99f58
Initializing CPU#1
masked ExtINT on CPU#1
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 1(2) -> Node 0 -> Core 0
 stepping 00
Synced TSC of CPU 1 difference 30064769976
Booting processor 2/2 rip 6000 rsp ffff81013ffa3f58
Initializing CPU#2
masked ExtINT on CPU#2
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 2(2) -> Node 1 -> Core 1
 stepping 00
Synced TSC of CPU 2 difference 30064770021
Booting processor 3/3 rip 6000 rsp ffff81007ff49f58
Initializing CPU#3
masked ExtINT on CPU#3
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 1024K (64 bytes/line)
CPU 3(2) -> Node 1 -> Core 1
 stepping 00
Synced TSC of CPU 3 difference 30064770021
Brought up 4 CPUs

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

end of thread, other threads:[~2005-05-09 21:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-28 19:49 x86-64 dual core mapping YhLu
2005-04-30  0:56 ` Siddha, Suresh B
  -- strict thread matches above, loose matches on Subject: below --
2005-05-09 21:24 YhLu
2005-05-04  0:18 YhLu
2005-05-04 13:18 ` Andi Kleen
2005-05-03 23:35 YhLu
2005-05-02 21:01 YhLu
2005-05-03 14:25 ` Andi Kleen
2005-05-02 19:41 YhLu
2005-05-02 20:18 ` Andi Kleen
2005-04-28 18:55 YhLu
2005-04-22  2:38 YhLu
2005-05-02 17:02 ` Andi Kleen

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).