atom feed9 messages in org.freebsd.freebsd-smpDisabling HyperThreading?
FromSent OnAttachments
Hubert TournierApr 25, 2010 9:17 am 
oklahomaApr 25, 2010 9:48 am 
Hubert TournierApr 25, 2010 3:58 pm 
oklahomaApr 26, 2010 2:58 am 
John BaldwinApr 26, 2010 6:47 am 
Jack L.May 5, 2010 8:40 am 
Hubert TournierMay 5, 2010 4:26 pm 
Hubert TournierMay 6, 2010 1:57 pm 
Hubert TournierMay 9, 2010 1:54 pm 
Subject:Disabling HyperThreading?
From:Hubert Tournier (hub@frbsd.org)
Date:Apr 25, 2010 9:17:49 am
List:org.freebsd.freebsd-smp

Hello (anybody there?),

Is there a way to disable "Hyper-Threading Technology" in modern FreeBSD systems?

At the time of FreeBSD-SA-05:09.htt, it was suggested to use the following workaround:

setting the "machdep.hlt_logical_cpus" tunable: # echo "machdep.hlt_logical_cpus=1" >> /boot/loader.conf Use of this workaround is not recommended on "dual-core" systems, as this workaround will also disable one of the processor cores.

But this OID no longer seems to exist and I do not want to disable other processor cores.

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

Best regards,

Hubert

For example on a bi-Xeon X5650 FreeBSD 8.0p2 system, the relevant sysctl OIDs are:

kern.ccpu: 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> <cpu count="12" mask="0xfff">0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11</cpu> <cpu count="2" mask="0x3">0, 1</cpu> <cpu count="2" mask="0xc">2, 3</cpu> <cpu count="2" mask="0x30">4, 5</cpu> <cpu count="2" mask="0xc0">6, 7</cpu> <cpu count="2" mask="0x300">8, 9</cpu> <cpu count="2" mask="0xc00">10, 11</cpu> <cpu count="12" mask="0xfff000">12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23</cpu> <cpu count="2" mask="0x3000">12, 13</cpu> <cpu count="2" mask="0xc000">14, 15</cpu> <cpu count="2" mask="0x30000">16, 17</cpu> <cpu count="2" mask="0xc0000">18, 19</cpu> <cpu count="2" mask="0x300000">20, 21</cpu> <cpu count="2" mask="0xc00000">22, 23</cpu> kern.smp.cpus: 24 debug.kdb.stop_cpus: 1 hw.ncpu: 24 machdep.hlt_cpus: 0

Perhaps by playing with the mask?