Re: cvs commit: src/sys/i386/i386 local_apic.c src/sys/amd64/amd64 local_apic.c

From: John Baldwin <>
Date: Tue, 5 Sep 2006 13:27:49 -0400
On Tuesday 05 September 2006 13:15, Maxim Sobolev wrote:
> sobomax     2006-09-05 17:15:25 UTC
>   FreeBSD src repository
>   Modified files:
>     sys/i386/i386        local_apic.c 
>     sys/amd64/amd64      local_apic.c 
>   Log:
>   The FreeBSD by default "disables" hyper-threading cores, by not scheduling
>   any threads to them. However, it still counts those cores as "active but
>   permanently idle" when calculating system-wide CPUs statistics. It is
>   incorrect, since it skews statistics quite a bit and creates real problems
>   for certain types of applications (monitoring applications for example),
>   by making them believe that the system does have enough idle CPU 
>   while in fact it does not.
>   Correct the problem by not calling performance counting routines 
on "disabled"
>   cores. The cleaner solution would be to just disable APIC timer interrupts 
>   those cores completely, but ENOTIME here and it is not clear if the
>   additional complexity really worth minor performance gain.

Is this going to break various places dividing stats by hw.ncpu (in userland) 
or mp_ncpus (in kernel)?  (That is, are there any such places.   If so, you
just broke them.)

John Baldwin
Received on Tue Sep 05 2006 - 17:28:03 UTC