Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jan 2005 11:50:36 +0100
From:      Tamas MEZEI <tamas@bazmag.hu>
To:        Frank Bonnet <f.bonnet@esiee.fr>
Cc:        freebsd-smp@freebsd.org
Subject:   Re: Compaq CPU ?
Message-ID:  <41E3AF7C.1070601@bazmag.hu>
In-Reply-To: <41E3A0FA.80006@esiee.fr>
References:  <41E3A0FA.80006@esiee.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
> when I perform the "top" command it seems to have two, but ...

There's one way to check the most recent dmesg.boot:
cat /var/run/dmesg.boot | grep cpu
but I guess if you have N CPUs and HT is turned on you'll see 2N CPUs as 
a result, so if you don't want to check sysctl values just read the 
first some lines from dmesg.boot.

It should tell that if hyperthreading is used or not. If so, you'll se 
something like "Hyperthreading: %d logical CPUs" at the CPU info 
section, and when you grep dmesg.boot for 'cpu', you'll get 
[cpu0..cpu(N-1)] and this is twice as many as the number of CPUs you have.

If you use HT (there's no HTT field in the Features list), and you grep 
for 'cpu', you'll get the real amount of CPUs you have.

Or, you could grab this whole stuff from sysctl, but maybe fussing with 
finding the value which tells you the truth is way slower than just 
reading some five lines of text.

Good luck,

Tamas



Tamas



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41E3AF7C.1070601>