Linux SMP mis-counts CPUs

Linux SMP mis-counts CPUs

Post by James R. Van Zan » Sat, 21 Dec 2002 05:38:53



I just installed Linux 2.4.20 on a new Compaq Proliant ML350 with two
Xeon processors.  I have configured the kernel with "CONFIG_SMP=y".
SMP seems to be working fine: The dhrystone benchmark reports 1700
MIPS, and two copies of the benchmark running simultaneously report
the same.  Three copies each report about 1100 MIPS.

However, /proc/cpuinfo reports *four* CPUs.  Likewise, top reports as
if there were four CPUs.  top comes from the Debian package procps,
version 2.0.7-8.  What's the story here?

                - Jim Van Zandt

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.20GHz
stepping        : 7
cpu MHz         : 2192.945
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips        : 4377.80

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.20GHz
stepping        : 7
cpu MHz         : 2192.945
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips        : 4377.80

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.20GHz
stepping        : 7
cpu MHz         : 2192.945
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips        : 4377.80

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.20GHz
stepping        : 7
cpu MHz         : 2192.945
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips        : 4377.80

 09:09:24 up 21:08,  4 users,  load average: 0.37, 0.08, 0.03
62 processes: 58 sleeping, 4 running, 0 zombie, 0 stopped
CPU states:  75.0% user,   0.1% system,   0.0% nice,  24.9% idle
Mem:    904312K total,   737444K used,   166868K free,   100636K buffers
Swap:   648712K total,        0K used,   648712K free,   471332K cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
13380 jrv       14   0   380  380   312 R    99.9  0.0   0:06 dhry21
13383 jrv       14   0   380  380   312 R    99.9  0.0   0:05 dhry21
13386 jrv       14   0   380  380   312 R    99.9  0.0   0:05 dhry21
13375 jrv        9   0   956  956   748 R     0.1  0.1   0:00 top
    1 root       8   0   428  428   376 S     0.0  0.0   0:05 init
    2 root       9   0     0    0     0 SW    0.0  0.0   0:01 keventd
    3 root      19  19     0    0     0 SWN   0.0  0.0   0:00 ksoftirqd_CPU0
    4 root      18  19     0    0     0 SWN   0.0  0.0   0:00 ksoftirqd_CPU1
    5 root      19  19     0    0     0 SWN   0.0  0.0   0:00 ksoftirqd_CPU2
    6 root      18  19     0    0     0 SWN   0.0  0.0   0:00 ksoftirqd_CPU3

 
 
 

Linux SMP mis-counts CPUs

Post by Dragan Cvetkovi » Sat, 21 Dec 2002 05:45:06



Quote:> I just installed Linux 2.4.20 on a new Compaq Proliant ML350 with two
> Xeon processors.  I have configured the kernel with "CONFIG_SMP=y".
> SMP seems to be working fine: The dhrystone benchmark reports 1700
> MIPS, and two copies of the benchmark running simultaneously report
> the same.  Three copies each report about 1100 MIPS.

> However, /proc/cpuinfo reports *four* CPUs.  Likewise, top reports as
> if there were four CPUs.  top comes from the Debian package procps,
> version 2.0.7-8.  What's the story here?

Hyperthreading?

Bye, Dragan

--
Dragan Cvetkovic,

To be or not to be is true. G. Boole      No it isn't.  L. E. J. Brouwer

 
 
 

Linux SMP mis-counts CPUs

Post by Kasper Dupon » Sat, 21 Dec 2002 06:34:29




> > I just installed Linux 2.4.20 on a new Compaq Proliant ML350 with two
> > Xeon processors.  I have configured the kernel with "CONFIG_SMP=y".
> > SMP seems to be working fine: The dhrystone benchmark reports 1700
> > MIPS, and two copies of the benchmark running simultaneously report
> > the same.  Three copies each report about 1100 MIPS.

> > However, /proc/cpuinfo reports *four* CPUs.  Likewise, top reports as
> > if there were four CPUs.  top comes from the Debian package procps,
> > version 2.0.7-8.  What's the story here?

> Hyperthreading?

Yes, it is hyperthreading. It was about time I got that question in the FAQ:
http://www.daimi.au.dk/~kasperd/comp.os.linux.development.faq.html#hy...

--
Kasper Dupont -- der bruger for meget tid p? usenet.

Hvem er fjenden i Aalborg?

 
 
 

Linux SMP mis-counts CPUs

Post by James R. Van Zan » Sun, 22 Dec 2002 05:43:25





>> > I just installed Linux 2.4.20 on a new Compaq Proliant ML350 with two
>> > Xeon processors. ...
>> > However, /proc/cpuinfo reports *four* CPUs.  Likewise, top reports as
>> > if there were four CPUs.  top comes from the Debian package procps,
>> > version 2.0.7-8.  What's the story here?

>Yes, it is hyperthreading. It was about time I got that question in the FAQ:
>http://www.daimi.au.dk/~kasperd/comp.os.linux.development.faq.html#hy...

Where I see the entry

    31.Why does Linux claim my dual Xeon computer has 4 CPUs?

    It claims so because your computer really has 4 CPUs. Each Xeon
    CPU contains two logical CPUs using a teqniue [sic] called hyperthreading.

Thanks!

I suppose that also explains this part of the boot messages:

  ...sor #7 Pentium 4(tm) XEON(tm) APIC version 16

  IOAPIC (id[0x2] address[0xfec00000] global_irq_base[0x0])
  IOAPIC (id[0x3] address[0xfec01000] global_irq_base[0x10])
  IOAPIC (id[0x4] address[0xfec02000] global_irq_base[0x20])
  IOAPIC (id[0x5] address[0xfec03000] global_irq_base[0x30])
  INT_SRC_OVR (bus[0] irq[0x0] global_irq[0x2] polarity[0x1] trigger[0x1])
  LAPIC_NMI (acpi_id[0x00ff] polarity[0x0] trigger[0x0] lint[0x1])
  8 CPUs total

                - Jim Van Zandt

 
 
 

Linux SMP mis-counts CPUs

Post by Andi Klee » Sun, 22 Dec 2002 07:00:59



Quote:

>     31.Why does Linux claim my dual Xeon computer has 4 CPUs?

>     It claims so because your computer really has 4 CPUs. Each Xeon
>     CPU contains two logical CPUs using a teqniue [sic] called hyperthreading.

There are Xeon CPUs that do not support Hyperthreading, e.g. the older P3 based
ones.

-Andi

 
 
 

Linux SMP mis-counts CPUs

Post by Kasper Dupon » Sun, 22 Dec 2002 09:18:56




> >     31.Why does Linux claim my dual Xeon computer has 4 CPUs?

> >     It claims so because your computer really has 4 CPUs. Each Xeon
> >     CPU contains two logical CPUs using a teqniue [sic] called hyperthreading.

> There are Xeon CPUs that do not support Hyperthreading, e.g. the older P3 based
> ones.

I have know changed the text to

  It claims so because your computer really has 4 CPUs. Some Xeon CPUs
  contain two logical CPUs each using a technique called hyperthreading.

is that better?

--
Kasper Dupont -- der bruger for meget tid p? usenet.

Hvem er fjenden i Aalborg?

 
 
 

Linux SMP mis-counts CPUs

Post by David Schwart » Sun, 22 Dec 2002 12:55:58



> I have know changed the text to

>   It claims so because your computer really has 4 CPUs. Some Xeon CPUs
>   contain two logical CPUs each using a technique called hyperthreading.

> is that better?

        Well, the "really" is a bit strained since there aren't two full CPUs.
How about: It claims so because your computer behaves as if it had 4
CPUs. Or something like that.

        DS

 
 
 

Linux SMP mis-counts CPUs

Post by Norman Blac » Wed, 25 Dec 2002 05:54:08




> > I have know changed the text to

> >   It claims so because your computer really has 4 CPUs. Some Xeon
CPUs
> >   contain two logical CPUs each using a technique called
hyperthreading.

> > is that better?

> Well, the "really" is a bit strained since there aren't two full CPUs.
> How about: It claims so because your computer behaves as if it had 4
> CPUs. Or something like that.

> DS

How about a single hyper-threaded "CPU" showing two "CPUs" will not
likely execute as fast as two separate non-hyperthreaded "CPUs". They
are "full" CPUs as far as application, operating system and hardware are
concerned.

--
Norman Black
Stony Brook Software
nospam => stonybrk

 
 
 

1. cpu-count > # of cpu's

Greetings

  We are using SCO Unix 3.2.4.2 MPX 3 with Oracle 7.2.2.4.
  There are 5 active cpu's. Via mpstat we have found that
  cpu 1 is utilized much more than the other 4. The cpu_count
  parameter in Oracle defaults to one. Can we assume that
  Oracle is only utilizing 1 cpu? Oracle support has stated
  that there is a bug with cpu_count reporting and initialy
  recommended that we force cpu_count = 5. However Oracle
  SupportLink recommends that we do not force cpu_count. No
  other solutions are forth coming. How can we get Oracle to
  recognize all available cpus. How do we verify that Oracle
  recognizes all available cpus.

  We have found 4 parameters in space.c that may improve Oracle
  performance under MPX. However I must relink unix and cannot
  so for until 10/25.

  If anyone has any insights about our situation I would
  greatly appreciate it.

                                 Thank you for your time
                                 John Z.

2. cdrom sane fallback vs 2.4.20-pre1

3. SMP: Tyan Tomcat III dual, only one CPU active in /proc/smp

4. disktab for Syquest

5. -ac6 mis-reports cpu clock

6. internal SCSI zip drive under UW7.0

7. how many cpus can linux support for SMP?

8. How do I stop the following from loading at boot?

9. Differents Bogomips for my two cpu's (Linux smp)

10. Any 486 SMP (multi-CPU) boards available for Linux?

11. Best NIC card -- LInux 2.4 SMP -> LInux 2.4 SMP

12. CPU utilization and Packet count...

13. HP - CPU count