Subject: Wrong number of cpus detected/reported

Hi,

first of all please apologize me because I didn't subscribe the list. I
really even don't know if this list is the appropriate place to have my
question discussed but I didn't found any better one.

I installed a RedHat 7.1 system on a 4 way 1.4 Gz Compaq DL580 server
with kernel 2.4.2 and everything goes right. Because of some other
prerequisite needs I had to upgrade the kernel to 2.4.9-34.

After the upgrade the system is reporting that the machine has 8 cpu
instead of 4. I have been looking for some kind of information on the
Internet (http://www.google.com/linux) about that but I didn't have success.

Does anybody can tell me if I will face some major problem and why the
system is detecting (or only reporting) the wrong number of cpus ? There
is anything that I can do to have my system detecting the right number
of cpus ?

Attached there are a tar.gz file containing :

nohup.out => standard output from make bzImage
modules.out => standard output from make modules
modules.err => standard error from make modules
cpuinfo => /proc/cpuinfo

The kernel was compiled using the kernel.....-enterprise config from
/usr/src/linux-2.4/configs (smp=yes, highmem=64M)

Thanks in advance.


Attachments:
files.tar.gz (40.28 kB)

2003-06-10 20:05:51

by John Appleby

[permalink] [raw]
Subject: RE: Wrong number of cpus detected/reported

> After the upgrade the system is reporting that the machine has 8 cpu
> instead of 4. I have been looking for some kind of information on the
> Internet (http://www.google.com/linux) about that but I didn't have success.

I suspect that it is identifying 4 Xeon CPUs with Hyperthreading, which
will correctly double the amount of processors your kernel thinks you
have. Intel's Hyperthreading

This ought to be a good thing... the only thing I don't quite understand
is that I thought Hyperthreading was added in 2.4.17.

Regards,

John


2003-06-10 20:04:24

by David Schwartz

[permalink] [raw]
Subject: RE: Wrong number of cpus detected/reported


> Hi,
>
> first of all please apologize me because I didn't subscribe the list. I
> really even don't know if this list is the appropriate place to have my
> question discussed but I didn't found any better one.
>
> I installed a RedHat 7.1 system on a 4 way 1.4 Gz Compaq DL580 server
> with kernel 2.4.2 and everything goes right. Because of some other
> prerequisite needs I had to upgrade the kernel to 2.4.9-34.
>
> After the upgrade the system is reporting that the machine has 8 cpu
> instead of 4. I have been looking for some kind of information on the
> Internet (http://www.google.com/linux) about that but I didn't have success.

This is correct. The machine has 8 logical CPUs implemented inside 4
physical CPUs. For more information, search Intel's web pages about
'hyperthreading'.

DS


2003-06-10 20:27:07

by Lauro, John

[permalink] [raw]
Subject: RE: Wrong number of cpus detected/reported

As someone else mentioned, it is probably hyper threading. Run 'top'
and see if you get per cpu stats. If it is hyperthreading, you should
be able to disable it in the BIOS.

IMO, hyperthreading is evil on an SMP box. The system doesn't know
that not all CPUs are not created equal, and so if you have 4 CPU
intensive processes, then you have a good chance that 2 of the
processes will run at a reduced rate on the same CPU and one (or 2)
CPUs stay mostly idle... All my benchmarks gave lower performance
with hyperthreading enabled. I forget the kernel version, but I think
it was 2.4.20, might have been 2.4.18.

On a single CPU box, hyperthreading is probably a plus. I wonder if
2.5 handles hyperthreading any better.

> -----Original Message-----
> From: Jos? Francisco Ribeiro Neto [mailto:[email protected]]
> Sent: Tuesday, June 10, 2003 2:51 PM
> To: [email protected]
> Subject: Wrong number of cpus detected/reported
> Importance: High
>
> Hi,
>
> first of all please apologize me because I didn't subscribe the
list. I
> really even don't know if this list is the appropriate place to have
my
> question discussed but I didn't found any better one.
>
> I installed a RedHat 7.1 system on a 4 way 1.4 Gz Compaq DL580
server
> with kernel 2.4.2 and everything goes right. Because of some other
> prerequisite needs I had to upgrade the kernel to 2.4.9-34.
>
> After the upgrade the system is reporting that the machine has 8 cpu
> instead of 4. I have been looking for some kind of information on
the
> Internet (http://www.google.com/linux) about that but I didn't have
success.
>
> Does anybody can tell me if I will face some major problem and why
the
> system is detecting (or only reporting) the wrong number of cpus ?
There
> is anything that I can do to have my system detecting the right
number
> of cpus ?
>
> Attached there are a tar.gz file containing :
>
> nohup.out => standard output from make bzImage
> modules.out => standard output from make modules
> modules.err => standard error from make modules
> cpuinfo => /proc/cpuinfo
>
> The kernel was compiled using the kernel.....-enterprise config from
> /usr/src/linux-2.4/configs (smp=yes, highmem=64M)
>
> Thanks in advance.

2003-06-10 20:29:48

by Samuel Flory

[permalink] [raw]
Subject: Re: Wrong number of cpus detected/reported

John Appleby wrote:

>>After the upgrade the system is reporting that the machine has 8 cpu
>>instead of 4. I have been looking for some kind of information on the
>>Internet (http://www.google.com/linux) about that but I didn't have success.
>>
>>
>
>I suspect that it is identifying 4 Xeon CPUs with Hyperthreading, which
>will correctly double the amount of processors your kernel thinks you
>have. Intel's Hyperthreading
>
>This ought to be a good thing... the only thing I don't quite understand
>is that I thought Hyperthreading was added in 2.4.17.
>
>
>

Red Hat enabled basic hyperthreading support in their 2.4.9 eratta
kernels some where along the line. I just didn't think 1.4 Xeons did
HT. (Maybe the MP Xeons are different from the DP xeons.)

--
There is no such thing as obsolete hardware.
Merely hardware that other people don't want.
(The Second Rule of Hardware Acquisition)
Sam Flory <[email protected]>


2003-06-10 20:42:25

by Timothy Miller

[permalink] [raw]
Subject: Re: Wrong number of cpus detected/reported



David Schwartz wrote:

>
> This is correct. The machine has 8 logical CPUs implemented inside 4
> physical CPUs. For more information, search Intel's web pages about
> 'hyperthreading'.
>


But if the kernel doesn't have HT support, then it won't necessarily
balance loads properly.


2003-06-10 20:57:14

by Steven Cole

[permalink] [raw]
Subject: Re: Wrong number of cpus detected/reported

On Tue, 2003-06-10 at 14:36, Samuel Flory wrote:
> John Appleby wrote:
>
> >>After the upgrade the system is reporting that the machine has 8 cpu
> >>instead of 4. I have been looking for some kind of information on the
> >>Internet (http://www.google.com/linux) about that but I didn't have success.
> >>
> >>
> >
> >I suspect that it is identifying 4 Xeon CPUs with Hyperthreading, which
> >will correctly double the amount of processors your kernel thinks you
> >have. Intel's Hyperthreading
> >
> >This ought to be a good thing... the only thing I don't quite understand
> >is that I thought Hyperthreading was added in 2.4.17.
> >
> >
> >
>
> Red Hat enabled basic hyperthreading support in their 2.4.9 eratta
> kernels some where along the line. I just didn't think 1.4 Xeons did
> HT. (Maybe the MP Xeons are different from the DP xeons.)

His does. From his cpuinfo:

processor : 7
vendor_id : GenuineIntel
cpu family : 15
model : 1
model name : Intel(R) Xeon(TM) CPU 1.40GHz
stepping : 1
cpu MHz : 1399.982
cache size : 256 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 mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips : 2798.38

See that ht flag near the end?

Don't know why he doesn't go with RH 9 or RH AS though.

Steven

2003-06-10 20:53:58

by John Appleby

[permalink] [raw]
Subject: RE: Wrong number of cpus detected/reported

> Red Hat enabled basic hyperthreading support in their 2.4.9 eratta
> kernels some where along the line. I just didn't think 1.4 Xeons did
> HT. (Maybe the MP Xeons are different from the DP xeons.)

The ML570 has the Gallatin CPU in it which does support HT.

Regards,

JA


2003-06-10 21:26:54

by Alan

[permalink] [raw]
Subject: Re: Wrong number of cpus detected/reported

> wp : yes
> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
> bogomips : 2798.38
>
> See that ht flag near the end?

The ht flag means the ht facilities (mtrr etc) are present, doesnt mean
HT necessarily is

2003-06-10 21:45:56

by Steven Cole

[permalink] [raw]
Subject: Re: Wrong number of cpus detected/reported

On Tue, 2003-06-10 at 15:35, Alan Cox wrote:
> > wp : yes
> > flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
> > bogomips : 2798.38
> >
> > See that ht flag near the end?
>
> The ht flag means the ht facilities (mtrr etc) are present, doesnt mean
> HT necessarily is

Is there a reliable method, apart from knowing 'a priori' the mapping
from CPU models and stepping to hyperthreading capability?

Steven

2003-06-10 21:58:25

by Alan

[permalink] [raw]
Subject: Re: Wrong number of cpus detected/reported

On Maw, 2003-06-10 at 22:52, Steven Cole wrote:
> Is there a reliable method, apart from knowing 'a priori' the mapping
> from CPU models and stepping to hyperthreading capability?

Except for building a collection of databooks and "specification updates" none
I know of.


2003-06-10 22:03:05

by Mikael Pettersson

[permalink] [raw]
Subject: Re: Wrong number of cpus detected/reported

Steven Cole writes:
> On Tue, 2003-06-10 at 15:35, Alan Cox wrote:
> > > wp : yes
> > > flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
> > > bogomips : 2798.38
> > >
> > > See that ht flag near the end?
> >
> > The ht flag means the ht facilities (mtrr etc) are present, doesnt mean
> > HT necessarily is
>
> Is there a reliable method, apart from knowing 'a priori' the mapping
> from CPU models and stepping to hyperthreading capability?

Yes. Execute cpuid with eax=1 on each CPU. ebx describes among other things
the number of threads and which thread you're on. If you ever find yourself
on a non-zero thread, you have HT.

2003-06-10 23:53:28

by Lauro, John

[permalink] [raw]
Subject: RE: Wrong number of cpus detected/reported

What kernels balance the loads properly? When I did some simple tests
with a dual Xeon 2.4, I couldn't get it Linux to balance properly.
About 30% of the time it would be off balance with two CPU bound
processes, and that is about the statistical rate. I think that was
with 2.4.20, but might have been 2.4.18. With 3 processes, one would
always get an unfair advantage compared to the other two.

> -----Original Message-----
> From: Timothy Miller [mailto:[email protected]]
> Sent: Tuesday, June 10, 2003 5:09 PM
> To: David Schwartz
> Cc: [email protected]; [email protected]
> Subject: Re: Wrong number of cpus detected/reported
>
> But if the kernel doesn't have HT support, then it won't necessarily
> balance loads properly.
>

2003-06-11 15:50:54

by Timothy Miller

[permalink] [raw]
Subject: Re: Wrong number of cpus detected/reported



[email protected] wrote:
> Steven Cole writes:
> > On Tue, 2003-06-10 at 15:35, Alan Cox wrote:
> > > > wp : yes
> > > > flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
> > > > bogomips : 2798.38
> > > >
> > > > See that ht flag near the end?
> > >
> > > The ht flag means the ht facilities (mtrr etc) are present, doesnt mean
> > > HT necessarily is
> >
> > Is there a reliable method, apart from knowing 'a priori' the mapping
> > from CPU models and stepping to hyperthreading capability?
>
> Yes. Execute cpuid with eax=1 on each CPU. ebx describes among other things
> the number of threads and which thread you're on. If you ever find yourself
> on a non-zero thread, you have HT.


I presume, however, that to get into a non-zero thread, you have to turn
HT on. That is, when the machine first powers up, there is nothing for
the second thread to execute, so it's turned off. (I'm assuming
something similar for SMP boxes.) So, the real question should be,
before you attempt to turn on HT, how do you find out whether or you CAN
turn on HT.


2003-06-11 16:15:12

by Mikael Pettersson

[permalink] [raw]
Subject: Re: Wrong number of cpus detected/reported

Timothy Miller writes:
>
>
> [email protected] wrote:
> > Steven Cole writes:
> > > On Tue, 2003-06-10 at 15:35, Alan Cox wrote:
> > > > > wp : yes
> > > > > flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
> > > > > bogomips : 2798.38
> > > > >
> > > > > See that ht flag near the end?
> > > >
> > > > The ht flag means the ht facilities (mtrr etc) are present, doesnt mean
> > > > HT necessarily is
> > >
> > > Is there a reliable method, apart from knowing 'a priori' the mapping
> > > from CPU models and stepping to hyperthreading capability?
> >
> > Yes. Execute cpuid with eax=1 on each CPU. ebx describes among other things
> > the number of threads and which thread you're on. If you ever find yourself
> > on a non-zero thread, you have HT.
>
>
> I presume, however, that to get into a non-zero thread, you have to turn
> HT on. That is, when the machine first powers up, there is nothing for
> the second thread to execute, so it's turned off. (I'm assuming
> something similar for SMP boxes.) So, the real question should be,
> before you attempt to turn on HT, how do you find out whether or you CAN
> turn on HT.

If the CPUs can't do it at all, #threads < 2 by the definition of CPUID.

I don't know that happens to the CPUID #threads value if the CPUs are
HT-capable but BIOS has disabled HT. (I'm not going to reboot our
Dual Xeon just to check this.) Why does it matter? If people BIOS-disable
HT in their Xeon boxes they get what they deserve. (Which is not to
say that doing so is wrong. HT isn't always a gain.)

2003-06-11 21:20:07

by Con Kolivas

[permalink] [raw]
Subject: Re: Wrong number of cpus detected/reported

On Thu, 12 Jun 2003 02:17, Timothy Miller wrote:
> [email protected] wrote:
> > Steven Cole writes:
> > > On Tue, 2003-06-10 at 15:35, Alan Cox wrote:
> > > > > wp : yes
> > > > > flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr mca cmov
> > > > > pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm bogomips :
> > > > > 2798.38
> > > > >
> > > > > See that ht flag near the end?
> > > >
> > > > The ht flag means the ht facilities (mtrr etc) are present, doesnt
> > > > mean HT necessarily is
> > >
> > > Is there a reliable method, apart from knowing 'a priori' the mapping
> > > from CPU models and stepping to hyperthreading capability?
> >
> > Yes. Execute cpuid with eax=1 on each CPU. ebx describes among other
> > things the number of threads and which thread you're on. If you ever find
> > yourself on a non-zero thread, you have HT.
>
> I presume, however, that to get into a non-zero thread, you have to turn
> HT on. That is, when the machine first powers up, there is nothing for
> the second thread to execute, so it's turned off. (I'm assuming
> something similar for SMP boxes.) So, the real question should be,
> before you attempt to turn on HT, how do you find out whether or you CAN
> turn on HT.
>
http://sourceforge.net/projects/cpucounter/

Con