On 09/02/10 11:32, Robert Sweetnam wrote:
> On 09/02/2010 11:34, Oliver Pfaff wrote:
>> Hi,
>>>> At OS level on Linux, without installing an extra program, is it possible
>> to identify whether hyperthreading is activated on a Xeon CPU without
>> knowledge about the CPU design or hardware?
>>>> Regards,
>>>> Oliver.
>>>> Hi,
>> cat /proc/cpuinfo
>> Look for 'ht' in the flags.
Nope, that just means it has certain instructions available.
You could determine from counts in /proc/cpuinfo I suppose:
cores=$(grep "core id" /proc/cpuinfo | sort -u | wc -l)
cpus=$(grep "processor" /proc/cpuinfo | sort -u | wc -l)
[ $cpus -eq $cores ] || ht=1
BTW there is a new `nproc` utility included now with coreutils
which counts the number of processors taking into account those
brought offline on the system, or those not made available to
the process with taskset.
Also I notice http://www.codemonkey.org.uk/projects/x86info/
has recently been updated to output cpu topology info.
cheers,
Pádraig.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!