public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: 2.6.12-rc5 is broken in nvidia Ck804 Opteron MB/with dual cor e dual way
@ 2005-06-02 18:56 YhLu
  2005-06-02 19:03 ` Dave Jones
  2005-06-02 19:06 ` Ashok Raj
  0 siblings, 2 replies; 16+ messages in thread
From: YhLu @ 2005-06-02 18:56 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

Really?,  smp_num_siblings is global variable and initially is set 1.

YH

> -----Original Message-----
> From: Andi Kleen [mailto:ak@muc.de] 
> Sent: Thursday, June 02, 2005 11:51 AM
> To: YhLu
> Cc: linux-kernel@vger.kernel.org
> Subject: Re: 2.6.12-rc5 is broken in nvidia Ck804 Opteron 
> MB/with dual cor e dual way
> 
> On Wed, Jun 01, 2005 at 08:16:35PM -0700, YhLu wrote:
> > andi,
> > 
> > in arch/x86_64/kernel/smboot.c, function detect_siblings(),
> > 
> > because smp_num_siblings is always =1,  so several lines 
> can be removed.
> 
> What do you mean? On intel systems with HyperThreading it is > 1.

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: 2.6.12-rc5 is broken in nvidia Ck804 Opteron MB/with dual cor e dual way
@ 2005-06-02 21:34 YhLu
  0 siblings, 0 replies; 16+ messages in thread
From: YhLu @ 2005-06-02 21:34 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

Can you duplicate the timing problem?

YH

> > Also I found the workaround for hang on second node is 
> adding one line 
> > in setup.c
> >         /* Low order bits define the core id (index of core 
> in socket) */
> >         cpu_core_id[cpu] = phys_proc_id[cpu] & ((1 << bits)-1);
> >         /* Convert the APIC ID into the socket ID */
> >         phys_proc_id[cpu] >>= bits;
> > +        printk(KERN_INFO "  CPU %d(%d)  phys_proc_id %d  
> Core %d\n", 
> > +               cpu, c->x86_num_cores, phys_proc_id[cpu], 
> > + cpu_core_id[cpu]);
> 
> That would just change the timing.
> 
> -Andi
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: 2.6.12-rc5 is broken in nvidia Ck804 Opteron MB/with dual cor e dual way
@ 2005-06-02 21:33 YhLu
  2005-06-03 16:12 ` Andi Kleen
  0 siblings, 1 reply; 16+ messages in thread
From: YhLu @ 2005-06-02 21:33 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

So siblings should be in one core...? that make sense....

YH 

> -----Original Message-----
> From: Andi Kleen [mailto:ak@muc.de] 
> Sent: Thursday, June 02, 2005 11:52 AM
> To: YhLu
> Cc: linux-kernel@vger.kernel.org
> Subject: Re: 2.6.12-rc5 is broken in nvidia Ck804 Opteron 
> MB/with dual cor e dual way
> 
> On Wed, Jun 01, 2005 at 08:26:00PM -0700, YhLu wrote:
> > Brought up 4 CPUs
> >     CPU 0, cpu_sibling_map[0]= 1 
> >     CPU 0, cpu_core_map[0]= 3 
> >     CPU 1, cpu_sibling_map[1]= 2 
> >     CPU 1, cpu_core_map[1]= 3 
> >     CPU 2, cpu_sibling_map[2]= 4 
> >     CPU 2, cpu_core_map[2]= c 
> >     CPU 3, cpu_sibling_map[3]= 8 
> >     CPU 3, cpu_core_map[3]= c
> > are the cpu_sibling_map[] right? 
> 
> Yes it is correct. A CPU is always a sibling of itself.
> 
> -Andi
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: 2.6.12-rc5 is broken in nvidia Ck804 Opteron MB/with dual cor e dual way
@ 2005-06-02 21:15 YhLu
  0 siblings, 0 replies; 16+ messages in thread
From: YhLu @ 2005-06-02 21:15 UTC (permalink / raw)
  To: YhLu, Ashok Raj; +Cc: Andi Kleen, linux-kernel

in  detect_ht
        if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c,
X86_FEATURE_CMP_LEGACY))
                return;

cpu_has(c, X86_FEATURE_CMP_LEGACY) for AMD is 1, so smp_num_siblings is not
changed and it is still initial value. (1)....

YH

> -----Original Message-----
> From: YhLu 
> Sent: Thursday, June 02, 2005 1:42 PM
> To: Ashok Raj
> Cc: Andi Kleen; linux-kernel@vger.kernel.org
> Subject: RE: 2.6.12-rc5 is broken in nvidia Ck804 Opteron 
> MB/with dual cor e dual way
> 
>         cpuid(1, &eax, &ebx, &ecx, &edx);
>         smp_num_siblings = (ebx & 0xff0000) >> 16;
> 
> For amd dual core, smp_num_siblings is set to 1, and it mean 
> has two cores.
> 
>                 seq_printf(m, "siblings\t: %d\n",
>                                 c->x86_num_cores * smp_num_siblings);
> 
> for Intel it would be 
> 	c->x86_num_cores  is 2 and smp_num_siblings is 2 too....
> 	so every core will be HT....
> 
> 
> Function 0000_0001[EBX]
> EBX[23:16] Logical Processor Count. If CPUID Fn[8000_0001, 
> 0000_0001][EDX:
> HTT, ECX:
> CMPLegacy] = 11b, then this field indicates the number of CPU 
> cores in the processor.
> Otherwise, this field is reserved.
> 
> what is intel value about cpuid(1) ebx [23:16], when the CPU 
> is dual core, but HT is disabled.
> 1?
> 
> YH
> 
> > -----Original Message-----
> > From: Ashok Raj [mailto:ashok.raj@intel.com]
> > Sent: Thursday, June 02, 2005 12:07 PM
> > To: YhLu
> > Cc: Andi Kleen; linux-kernel@vger.kernel.org
> > Subject: Re: 2.6.12-rc5 is broken in nvidia Ck804 Opteron 
> MB/with dual 
> > cor e dual way
> > 
> > On Thu, Jun 02, 2005 at 11:56:25AM -0700, YhLu wrote:
> > > 
> > >    Really?,  smp_num_siblings is global variable and
> > initially is set 1.
> > > 
> > >    YH
> > > 
> > But detect_ht() can override it.. thats just the start value.
> > 
> > try cscope :-)
> > 
> > Cheers,
> > ashok
> > 
> -
> To unsubscribe from this list: send the line "unsubscribe 
> linux-kernel" in the body of a message to 
> majordomo@vger.kernel.org More majordomo info at  
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: 2.6.12-rc5 is broken in nvidia Ck804 Opteron MB/with dual cor e dual way
@ 2005-06-02 20:42 YhLu
  2005-06-03 16:09 ` Andi Kleen
  0 siblings, 1 reply; 16+ messages in thread
From: YhLu @ 2005-06-02 20:42 UTC (permalink / raw)
  To: Ashok Raj; +Cc: Andi Kleen, linux-kernel

        cpuid(1, &eax, &ebx, &ecx, &edx);
        smp_num_siblings = (ebx & 0xff0000) >> 16;

For amd dual core, smp_num_siblings is set to 1, and it mean has two cores.

                seq_printf(m, "siblings\t: %d\n",
                                c->x86_num_cores * smp_num_siblings);

for Intel it would be 
	c->x86_num_cores  is 2 and smp_num_siblings is 2 too....
	so every core will be HT....


Function 0000_0001[EBX]
EBX[23:16] Logical Processor Count. If CPUID Fn[8000_0001, 0000_0001][EDX:
HTT, ECX:
CMPLegacy] = 11b, then this field indicates the number of CPU cores in the
processor.
Otherwise, this field is reserved.

what is intel value about cpuid(1) ebx [23:16], when the CPU is dual core,
but HT is disabled.
1?

YH

> -----Original Message-----
> From: Ashok Raj [mailto:ashok.raj@intel.com] 
> Sent: Thursday, June 02, 2005 12:07 PM
> To: YhLu
> Cc: Andi Kleen; linux-kernel@vger.kernel.org
> Subject: Re: 2.6.12-rc5 is broken in nvidia Ck804 Opteron 
> MB/with dual cor e dual way
> 
> On Thu, Jun 02, 2005 at 11:56:25AM -0700, YhLu wrote:
> > 
> >    Really?,  smp_num_siblings is global variable and 
> initially is set 1.
> > 
> >    YH
> > 
> But detect_ht() can override it.. thats just the start value.
> 
> try cscope :-)
> 
> Cheers,
> ashok
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: 2.6.12-rc5 is broken in nvidia Ck804 Opteron MB/with dual cor e dual way
@ 2005-06-02 18:55 YhLu
  0 siblings, 0 replies; 16+ messages in thread
From: YhLu @ 2005-06-02 18:55 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

So core1 is not the sibling of core0?

YH 

> -----Original Message-----
> From: Andi Kleen [mailto:ak@muc.de] 
> Sent: Thursday, June 02, 2005 11:52 AM
> To: YhLu
> Cc: linux-kernel@vger.kernel.org
> Subject: Re: 2.6.12-rc5 is broken in nvidia Ck804 Opteron 
> MB/with dual cor e dual way
> 
> On Wed, Jun 01, 2005 at 08:26:00PM -0700, YhLu wrote:
> > Brought up 4 CPUs
> >     CPU 0, cpu_sibling_map[0]= 1 
> >     CPU 0, cpu_core_map[0]= 3 
> >     CPU 1, cpu_sibling_map[1]= 2 
> >     CPU 1, cpu_core_map[1]= 3 
> >     CPU 2, cpu_sibling_map[2]= 4 
> >     CPU 2, cpu_core_map[2]= c 
> >     CPU 3, cpu_sibling_map[3]= 8 
> >     CPU 3, cpu_core_map[3]= c
> > are the cpu_sibling_map[] right? 
> 
> Yes it is correct. A CPU is always a sibling of itself.
> 
> -Andi
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: 2.6.12-rc5 is broken in nvidia Ck804 Opteron MB/with dual cor e dual way
@ 2005-06-02  3:26 YhLu
  2005-06-02 18:51 ` Andi Kleen
  0 siblings, 1 reply; 16+ messages in thread
From: YhLu @ 2005-06-02  3:26 UTC (permalink / raw)
  To: YhLu, Andi Kleen; +Cc: linux-kernel

Brought up 4 CPUs
    CPU 0, cpu_sibling_map[0]= 1 
    CPU 0, cpu_core_map[0]= 3 
    CPU 1, cpu_sibling_map[1]= 2 
    CPU 1, cpu_core_map[1]= 3 
    CPU 2, cpu_sibling_map[2]= 4 
    CPU 2, cpu_core_map[2]= c 
    CPU 3, cpu_sibling_map[3]= 8 
    CPU 3, cpu_core_map[3]= c 
are the cpu_sibling_map[] right? 

YH

> -----Original Message-----
> From: YhLu 
> Sent: Wednesday, June 01, 2005 8:17 PM
> To: Andi Kleen
> Cc: linux-kernel@vger.kernel.org
> Subject: RE: 2.6.12-rc5 is broken in nvidia Ck804 Opteron 
> MB/with dual cor e dual way
> 
> andi,
> 
> in arch/x86_64/kernel/smboot.c, function detect_siblings(),
> 
> because smp_num_siblings is always =1,  so several lines can 
> be removed.
> 
>         for_each_online_cpu (cpu) {
>                 struct cpuinfo_x86 *c = cpu_data + cpu;
> *R*                int siblings = 0;
>                 int i;
> *R*                if (smp_num_siblings > 1) {
> *R*                        for_each_online_cpu (i) {
> *R*                                if (cpu_core_id[cpu] == 
> cpu_core_id[i]) {
> *R*                                        siblings++;
> *R*                                        cpu_set(i, 
> cpu_sibling_map[cpu]);
> *R*                                }
> *R*                        }
> *R*                } else {
> *R*                      siblings++;
>                         cpu_set(cpu, cpu_sibling_map[cpu]);
> *R*                }
> 
> 
>  *R*               if (siblings != smp_num_siblings) {
>  *R*                       printk(KERN_WARNING
>  *R*              "WARNING: %d siblings found for CPU%d, 
> should be %d\n",
>  *R*                              siblings, cpu, smp_num_siblings);
>  *R*                       smp_num_siblings = siblings;
>  *R*               }
> 
> Also I found the workaround for hang on second node is adding 
> one line in setup.c
>         /* Low order bits define the core id (index of core 
> in socket) */
>         cpu_core_id[cpu] = phys_proc_id[cpu] & ((1 << bits)-1);
>         /* Convert the APIC ID into the socket ID */
>         phys_proc_id[cpu] >>= bits;
> +        printk(KERN_INFO "  CPU %d(%d)  phys_proc_id %d  Core %d\n", 
> +               cpu, c->x86_num_cores, phys_proc_id[cpu], 
> + cpu_core_id[cpu]);
> 
> My compile environment SUSE 9.2 gcc version is 3.3.3???
> 
> YH
> 
> -
> To unsubscribe from this list: send the line "unsubscribe 
> linux-kernel" in the body of a message to 
> majordomo@vger.kernel.org More majordomo info at  
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: 2.6.12-rc5 is broken in nvidia Ck804 Opteron MB/with dual cor e dual way
@ 2005-06-02  3:16 YhLu
  2005-06-02 18:50 ` Andi Kleen
  0 siblings, 1 reply; 16+ messages in thread
From: YhLu @ 2005-06-02  3:16 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

andi,

in arch/x86_64/kernel/smboot.c, function detect_siblings(),

because smp_num_siblings is always =1,  so several lines can be removed.

        for_each_online_cpu (cpu) {
                struct cpuinfo_x86 *c = cpu_data + cpu;
*R*                int siblings = 0;
                int i;
*R*                if (smp_num_siblings > 1) {
*R*                        for_each_online_cpu (i) {
*R*                                if (cpu_core_id[cpu] == cpu_core_id[i]) {
*R*                                        siblings++;
*R*                                        cpu_set(i, cpu_sibling_map[cpu]);
*R*                                }
*R*                        }
*R*                } else {
*R*                      siblings++;
                        cpu_set(cpu, cpu_sibling_map[cpu]);
*R*                }


 *R*               if (siblings != smp_num_siblings) {
 *R*                       printk(KERN_WARNING
 *R*              "WARNING: %d siblings found for CPU%d, should be %d\n",
 *R*                              siblings, cpu, smp_num_siblings);
 *R*                       smp_num_siblings = siblings;
 *R*               }

Also I found the workaround for hang on second node is
adding one line in setup.c
        /* Low order bits define the core id (index of core in socket) */
        cpu_core_id[cpu] = phys_proc_id[cpu] & ((1 << bits)-1);
        /* Convert the APIC ID into the socket ID */
        phys_proc_id[cpu] >>= bits;
+        printk(KERN_INFO "  CPU %d(%d)  phys_proc_id %d  Core %d\n", 
+               cpu, c->x86_num_cores, phys_proc_id[cpu], cpu_core_id[cpu]);

My compile environment SUSE 9.2 gcc version is 3.3.3???

YH


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

end of thread, other threads:[~2005-06-03 19:27 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-02 18:56 2.6.12-rc5 is broken in nvidia Ck804 Opteron MB/with dual cor e dual way YhLu
2005-06-02 19:03 ` Dave Jones
2005-06-03 19:26   ` Siddha, Suresh B
2005-06-02 19:06 ` Ashok Raj
  -- strict thread matches above, loose matches on Subject: below --
2005-06-02 21:34 YhLu
2005-06-02 21:33 YhLu
2005-06-03 16:12 ` Andi Kleen
2005-06-02 21:15 YhLu
2005-06-02 20:42 YhLu
2005-06-03 16:09 ` Andi Kleen
2005-06-03 18:56   ` Siddha, Suresh B
2005-06-02 18:55 YhLu
2005-06-02  3:26 YhLu
2005-06-02 18:51 ` Andi Kleen
2005-06-02  3:16 YhLu
2005-06-02 18:50 ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox