Operating System - Linux
1820298 Members
3078 Online
109622 Solutions
New Discussion юеВ

Re: hyperthreading enabled/disabled?

 
SOLVED
Go to solution
Vijaya Kumar_3
Respected Contributor

hyperthreading enabled/disabled?

I have a Compaq DL380 G3 with 4 processors and 4 GB RAM. I am running redhat Linux 8.0

I need to know "Hyperthreading" is enabled in BIOS? How can i check that?

Thanks
Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
26 REPLIES 26
Vijaya Kumar_3
Respected Contributor

Re: hyperthreading enabled/disabled?

Sorry...
I dont want to reboot.
I need a command line...

Thanks
Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
F Javier Gonzalez Marti
Occasional Advisor

Re: hyperthreading enabled/disabled?

With top command?

This command shows the number of CPU in your machine.
Vijaya Kumar_3
Respected Contributor

Re: hyperthreading enabled/disabled?

Thanks for ur quick reply...
what does that mean...
It shows 4 processors with CPU 0 to 4
What dows that mean?

Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
Umapathy S
Honored Contributor

Re: hyperthreading enabled/disabled?

Vijay,
For hyperthreading, you should be really running SMP Linux. Can you post the kernel version. I suppose RH 8.0 is not supporting hyperthreading. You may need to recompile the kernel with SMP support.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Vijaya Kumar_3
Respected Contributor

Re: hyperthreading enabled/disabled?

Thanks for ur reply Umapathy

Btw, I am running SMP Kernel
2.4.18-14smp


Thanks
Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
Umapathy S
Honored Contributor

Re: hyperthreading enabled/disabled?

Vijay,

What is there in /proc/cpu?

Since it a 4 physical processor machine, it should show 8 inside /proc/cpu. Otherwise, it is not supporting hyperthreading.

hth
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Huc_1
Honored Contributor

Re: hyperthreading enabled/disabled?

the following command should be able to tell you this!

# sysctl -A | grep -i "threa"

also have a look at

#procinfo


Hope this will help you


J-P
Smile I will feel the difference
U.SivaKumar_2
Honored Contributor

Re: hyperthreading enabled/disabled?

Hi,

You dont have hyper threading currently.
reboot the server.
Press F9 key to get in to BIOS

Go to Advanced options ( set the below value)

Processor Hyper-Threading enabled

Save BIOS config and reboot the server.

Now after linux has booted.

give

#top

which should show number of processors more than the actual (physical) number of processors.

regards,

U.SivaKumar
Innovations are made when conventions are broken
U.SivaKumar_2
Honored Contributor

Re: hyperthreading enabled/disabled?

To be more precise , to confirm that hyper-threading is functioning in your setup . you should see 8 processors in top screen.

viz. 2 logical processor per 1 physical processor.

regards,

U.SivaKumar
Innovations are made when conventions are broken
K.C. Chan
Trusted Contributor

Re: hyperthreading enabled/disabled?

Sorry, I believe you need to reboot for this. Basically you need to have this enable at the BIOS level. AFAIK, HT is available starting in 2.4.18 kernel.


Reputation of a thousand years can be determined by the conduct of an hour
Vijaya Kumar_3
Respected Contributor

Re: hyperthreading enabled/disabled?

Thanks people.

Regards
Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
John Daily
New Member

Re: hyperthreading enabled/disabled?

FYI - A DL380 G3 can only have 2 Physical Processors - so if you see 4, Hyperthreading is turned on.
Olivier Drouin
Trusted Contributor

Re: hyperthreading enabled/disabled?

You beat me @ it john.
HyperThreading is on by default, well, on hp/compaq machines...
Roberto Polli
Trusted Contributor

Re: hyperthreading enabled/disabled?

Hi all:

cat /proc/cpu|grep ht

if this flag "ht" is present in /proc/cpu then hyperthreading is enabled.
Peace, R.
Martin P.J. Zinser
Honored Contributor

Re: hyperthreading enabled/disabled?

Hi,

this should be /proc/cpuinfo, not /proc/cpu (at least on my Fedora and SuSE systems).

Greetings, Martin
Hein van den Heuvel
Honored Contributor
Solution

Re: hyperthreading enabled/disabled?



Roberto wrote:

"if this flag "ht" is present in /proc/cpu then hyperthreading is enabled."

Hmm, I beg to differ. I believe that just means that the processor is ht capeable, not whether it is active or not.

Intuitively I'd say like U.SivaKumar just use top and see how many CPU's it lists. However, that could misguide you if the BOX is for example made for 4 CPUs, but only 2 are installed... with HT still showing 4 CPUs.

I think the best solution is:
grep -E "processor|physical id" /proc/cpuinfo
And even that is slightly inconsistent on my systems with:

My 4P dl560 running " SuSE SLES 8 (powered by UnitedLinux 1.0) (i586)\nKernel 2.4.21-138-smp (1)" With HT enabled shows:
grep -E "processor|physical id" /proc/cpuinfo
processor : 0
physical id : 0
processor : 1
physical id : 0
processor : 2
physical id : 1
processor : 3
physical id : 1
processor : 4
physical id : 2
processor : 5
physical id : 2
processor : 6
physical id : 3
processor : 7
physical id : 3

But on older box running "SuSE SLES 8 (powered by UnitedLinux 1.0) (i586)\nKernel 2.4.19-64GB-SMP (2)" and NO HT shows:
processor : 0
physical id : 0
processor : 1
physical id : 0
processor : 2
physical id : 0
processor : 3
physical id : 0

So yes you can see what is happening, but not clearly.


JP Huc wrote : "the following command should be able to tell you this!
# sysctl -A | grep -i "threa"

Hmmm... not on my box! (It just returns "kernel.threads-max = 14336")

And procinfo does tell me how many CPUs, but not whether they are virtual or physical.
So like the 'top' solution I could get a false negative when less then halve of the possible CPUs are physically installed.


vijay wrote: "what does that mean... It shows 4 processors with CPU 0 to 4"
It means you did not read carefully, or someoen is playing a joke on you.
4 CPUS would be labeled CPU0 thru CPU3 (or maybe my english is not sharp enough and your 'to' really meant 'up to, but not including :-).

John Daily had the keenest response and should get the 10 Points... if his timing had been better.

fwiw,
Hein.







Jeroen Peereboom
Honored Contributor

Re: hyperthreading enabled/disabled?

Hein,

nice analysis.

I just switched off hyperthreading on my DL360. I didn't check all responses here like you did, but the reply that a DL380 (and I hope a DL360 too) can have at most 2 CPU's triggered me. Using top I saw 4 CPUs. After rebooting and switching off hyperthreading top only showed 2.

JP.
Hein van den Heuvel
Honored Contributor

Re: hyperthreading enabled/disabled?

Jeroen,

Are you going to share with us why you are switching of Hyperthreading? If it is to evaluate the gain/losse s for it, please share that with us the findings with a rough description of the application!
(tight loops, large foot-print, little memory touched, lots of memory, oltp? web? a few, dozens or hundreds of processes per cpu? and so on.)

Met vriendelijke groetjes,
Hein.
Jeroen Peereboom
Honored Contributor

Re: hyperthreading enabled/disabled?

Hein,

don't be surprised but I'm not sure if I need to switch it off.

I'm installing a test Oracle RAC cluster. I was told that when using Oracle parallel queries you should not have hyperthreading enabled.

I have it on a question list for the Oracle consultant I will be talking to in the (near) future.

Groeten,

Jeroen P.
Roberto Polli
Trusted Contributor

Re: hyperthreading enabled/disabled?

Hi Jeroen,
you said you got the HT disabled on your HT-capable machine.
Can you please, confirm if
grep ht /proc/cpuinfo
works for detecting ht?

Thank you very much,

Peace, R.
Martin P.J. Zinser
Honored Contributor

Re: hyperthreading enabled/disabled?

Hello Roberto,

I think Heins analysis is valid. On my hp/Compaq Evo I get:

[zinser@DHCP-FEX2-326-9 zinser]$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 2.40GHz

i.e. once CPU seen, but
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 pbe cid

i.e. potentially it seems I could enable hyperthreading on this box.

Greetings, Martin


P.S. One obvious reason to switch of HT when running Oracle is that they charge you by "CPU" ;-)
Roberto Polli
Trusted Contributor

Re: hyperthreading enabled/disabled?

After reading Hein post I check it on my
2xXeon Proliant DL380 and ML530 using RH8.0A and I found

grep 'Phys' /proc/cpuinfo
Physical processor ID : 0
Physical processor ID : 0
Physical processor ID : 3
Physical processor ID : 3

So I think
grep 'Phys' /proc/cpuinfo |uniq|wc -l
[sure you can do it with awk too bu it's easy to read!]
should work for indicating #physical cpus.

Does it work for you?

Thanks all for your inputs!!!
Stuart Browne
Honored Contributor

Re: hyperthreading enabled/disabled?

Nah, /proc/cpuinfo's references to "Physical" processors isn't true Physical. It both physical and HT-virtual processors as 'physical'.

Kinda frustrating ;)
One long-haired git at your service...
Jeroen Peereboom
Honored Contributor

Re: hyperthreading enabled/disabled?

Roberto,

on Red Hat AS2.1 I executed 'cat /proc/cpuinfo'.

The difference is that with hyperthreading on I have twice as many lines as without. It shows processor 0, 1, 2, 3 i.s.o. 0, 1.
My 'cpu Mhz' is also .9 Mhz lower ;-).
Sample output (with ht):

processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Xeon(TM) CPU 3.06GHz
stepping : 9
cpu MHz : 3065.891
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 : 6121.06

processor : 1
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Xeon(TM) CPU 3.06GHz
....

The only place I see 'ht' is in the flags line. But this line is not influenced by enabling/disabling hyperthreading.

Greetings,

JP.