enable smp / hyperthreading
freebsd01 at dgmm.net
Thu Nov 17 23:02:41 GMT 2005
On Monday 07 November 2005 18:53, jwl at io.dk wrote:
> I've just installed 6.0-RELASE and am trying to get SMP to work (I have af
> Pentium 4 with HT). So I've compiled the kernel with 'options SMP' and
> according to dmesg the two CPUs are found:
> FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
> cpu0 (BSP): APIC ID: 0
> cpu1 (AP): APIC ID: 1
> But I'm not sure that both are enabled, because at this is at the end of
> dmesg and I dont see the other CPU being enabled somewhere:
> SMP: AP CPU #1 Launched!
> According to 'sysctl -a' there are 2 CPUs, but only 1 active and SMP
> doesnt seem to be disabled:
> kern.smp.cpus: 2
> kern.smp.disabled: 0
> kern.smp.active: 1
> So I thought that it might help to but 'kern.smp.active=2' in
> /boot/loader.conf, but after a reboot it is back to 1 again.
> What am I missing here?
I'm sure people more knowledgeable than me will be able to confirm or comment
further on the following but here goes anyway.
From my point of view, using SMP with a single HT processor is a waste of time
unless you routinely run multiple programmes which require an approximately
equal amount of CPU time or you need to keep about half of your CPU time free
for other programs.
For example, encoding video with mplayer on a P4 with SMP enabled only used
one virtual CPU. It encodes approx. twice as fast with SMP switched off (and
HT switched off in BIOS) There does appear to be some lost CPU cycles due to
HT switching too.
Note that I've not done any serious testing or looked deeply into this
subject. This is simply my limited experience.
More information about the freebsd-questions