Is hyper-threading enabled on a Linux system ?
When you need to know whether hyper-threading is enabled without the luxury to reboot the system (and consulting the BIOS), you can simply look at the output of /proc/cpuinfo and compare the siblings with the cpu cores fields.
Even though /proc/cpuinfo shows you all the logical CPUs (processor field) in the system, the siblings field holds the number of logical CPUs for the physical CPU this entry belongs to (including both the cores and the hyper-threaded LCPUs).
In other words, if you see:
processor : 7
physical id : 9
siblings : 4
cpu cores : 2
It means that LCPU #7 (the eight logical CPU in your system) is one of the 4 logical CPUs on the physical CPU that has 2 cores. So yes, hyper-threading is enabled.
If the number of cpu cores is the same as the number of siblings, hyper-threading is disabled.
If you want to make sure how many physical CPUs are in the system, you can use the above information to calculate the number of physical CPUs. However simply counting the different physical id fields is easier.
You could also count the number of sockets that are populated from the dmidecode output, if you really want to make sure the kernel is accounting for all of them.
Update: If you want to disable hyper-threading online (and selectively) on RHEL5/CentOS-5 you can do this by disabling the HT processor by doing:
echo 0 >/sys/devices/system/node/node0/cpu2/online
But in general it is better to disable it in the BIOS if you don't need HT at all.