Disabling HyperThreading?

Hubert Tournier hubert at frbsd.org
Sun May 9 20:55:25 UTC 2010


Hello,


Hubert Tournier wrote:
> 
> I'll give a try to John's way of disabling CPUs, hoping to avoid disabling
> the wrong ones.
> 

With the kern.sched.topology_spec OID, i had the confirmation that the
hyperthreading "other halves" of the CPU were the even ones:

#sysctl kern.sched.topology_spec
kern.sched.topology_spec: <groups>
 <group level="1" cache-level="0">
  <cpu count="24" mask="0xffffff">0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23</cpu>
  <flags></flags>
  <children>
   <group level="3" cache-level="2">
    <cpu count="12" mask="0xfff">0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11</cpu>
    <flags></flags>
    <children>
     <group level="5" cache-level="1">
      <cpu count="2" mask="0x3">0, 1</cpu>
      <flags><flag name="THREAD">SMT group</flag>
</flags>
     </group>
     <group level="5" cache-level="1">
      <cpu count="2" mask="0xc">2, 3</cpu>
      <flags><flag name="THREAD">SMT group</flag>



Hubert Tournier wrote:
> 
> My use case is a VirtualBox dedicated server where I believe using HTT
> might be problematic because:
> 1/ running two busy virtual machines on the same physical core could
> severely impact their performance
> 2/ the virtualizer might expose the real CPU to the virtual machines,
> which might in turn attempt to use HTT for themselves 
> 

2/ The real CPU (or at least its HTT feature) is exposed to the virtual
machines, but they don't attempt to use HyperThreading (or at least the
FreeBSD guest that I use).

Looking at the differences between my FreeBSD host and guest, i noticed that
there were 2 additional OID in the guest:
 machdep.hlt_logical_cpus: 0
 machdep.logical_cpus_mask: 254

The vCPU given to the guest appears as cores: "FreeBSD/SMP: 1 package(s) x 8
core(s)".

1/ The risk is confirmed by the now-oracle engineers.

I think i will leave the hyperthreading enabled and just be careful not to
use more vCPU than the number of cores.

Thanks to all of you for your help and time.

Best regards,

Hubert
-- 
View this message in context: http://old.nabble.com/Disabling-HyperThreading--tp28357071p28505250.html
Sent from the freebsd-smp mailing list archive at Nabble.com.



More information about the freebsd-smp mailing list