High Pitched Whine

Michal Mertl mime at traveller.cz
Mon Jun 5 16:53:00 PDT 2006

Paul Lipps wrote:
> Hello,
> I am fairly new to FreeBSD (5.4 was my first version) and I have ran  
> into an issue that I think is related to the SMP capabilities of  
> FreeBSD. I apologize in advance if this topic is inappropriate for  
> this mailing list.

I believe it isn't really appropriate.

> When I am running FreeBSD, my computer emits a high pitched whining  
> noise. It's not a 'physical' noise like a fan or hard disk grinding,  
> it's more of a electrical whine. It's driving me nuts though, it's  
> like a dog whistle. This does not happen when I run any versions of  
> Windows or Linux. This has been the case for all versions of FreeBSD  
> I have had installed, 5.4, 6.0, and 6.1.

I think that someone reported it before and I think the cure was to
change the hz setting - try to enter kern.hz=100 in the loader prompt
(or add it to /boot/loader.conf).

> I recently discovered when I do:
> sysctl machdep.cpu_idle_hlt=0
> the high pitch whine stops.
> I have a P4 with HyperThreading, and FreeBSD 6.1 installed a SMP  
> kernel by default. I built a non-SMP kernel, and the high pitch whine  
> is still there.
> So I did a:
> sysctl machdep.cpu_idle_hlt=0
> after installing the non-SMP kernel and again the whine stopped.
> I tried disabling HTT in the BIOS under both the SMP and the non-SMP  
> kernel and the whine remained. So regardless if HTT is enabled in the  
> BIOS or not, and regardless if I'm running an SMP kernel or not, the  
> only thing that gets rid of the high pitch whine is:
> sysctl machdep.cpu_idle_hlt=0
> Now there is another problem. When I do the command above, the CPU  
> temperature rises rapidly. I can tell as my cooling system has a auto- 
> throttling fan (Shuttle XPC) and I hear the fan increase in speed  
> quickly and steadily after I 'unhalt' the 2nd logical CPU. So the 2nd  
> logical CPU must be getting stuck in a loop or something, I'm not  
> sure really how to see what is happening.

You are probably misunderstanding what machdep.cpu_idle_hlt does - it
tells the idle thread(s) that when there's no work for a processor it
issues the hlt instuction. Processors enter some light sleeping mode,
reduce clockspeed or whatever and therefore get cooler.

There are better/more modern methods to reduce the power and get the
temperature down - ACPI Cx states and others methods but they aren't
generally much available/effective on desktop machines AFAIK. It should
normally work out of the box. See cpufreq manual page, sysctl dev.cpu,
dev.acpi_throttle, dev.cpufreq, dev.est, dev.p4tcc and
hw.acpi.cpu.cx_supported. I haven't seen much of it documented anywhere
though and I don't really understand all of it either.

With modern FreeBSD, HTT cores aren't actually used for anything by
default. Performance improvements of HTT are usually minimal at best
anyway and there is known security vulnerability in HTT. To enable HTT
in FreeBSD it needs to be enabled in the HW (normally via a BIOS
setting) and in FreeBSD - as all the computers with HTT CPU's I have
access to are configured to disable it in the BIOS I am not sure how to
enable it in FreeBSD - there is probably tunable/sysctl
machdep.hyperthreading_allowed and hlt_logical_cpus which can probably
be used to turn it on.

To see whether HTT really works you should see in top command column 'C'
and some processes (other than idle) should be running on CPU 1.

> If anyone has any suggestions as to how this issue could be resolved,  
> or could point me in the right direction, I would appreciate it. I  
> would be happy to provide dmesg or any other information if it would  
> be helpful.
> Thank You for your time,
> Paul Lipps
> paul.lipps at gmail.com
> _______________________________________________
> freebsd-smp at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-smp
> To unsubscribe, send any mail to "freebsd-smp-unsubscribe at freebsd.org"

More information about the freebsd-smp mailing list