View previous topic :: View next topic |
Author |
Message |
few Guru
Joined: 03 Mar 2008 Posts: 448
|
Posted: Fri May 29, 2009 5:46 am Post subject: How to disable hyperthreading in the kernel? |
|
|
Is it possible to tell the kernel to not use HT if it is enabled in the BIOS? Disabling in the BIOS is no option since I would have to do it on 64 systems.
Thanks for your help.
Edit: I forgot to mention, that disabling SMP is no option either, because there are two CPUs on each board. |
|
Back to top |
|
|
massimo Veteran
Joined: 22 Jun 2003 Posts: 1226
|
Posted: Fri May 29, 2009 6:10 am Post subject: |
|
|
Put noht in your boot loaders configuration file in the corresponding kernel line. _________________ Hello 911? How are you? |
|
Back to top |
|
|
few Guru
Joined: 03 Mar 2008 Posts: 448
|
Posted: Sat May 30, 2009 10:42 am Post subject: |
|
|
massimo wrote: | Put noht in your boot loaders configuration file in the corresponding kernel line. |
Did so, no change. |
|
Back to top |
|
|
few Guru
Joined: 03 Mar 2008 Posts: 448
|
Posted: Sat May 30, 2009 11:16 am Post subject: |
|
|
Thanks to Theimon on #gentoo who pointed me to [1], I have now a workaround.
cat /etc/init.d/disable_ht
#!/sbin/runscript
depend() {
before gmond
}
start() {
ebegin "Disable CPU 1 und 3: "
echo 0 > /sys/devices/system/cpu/cpu1/online
echo 0 > /sys/devices/system/cpu/cpu3/online
eend $? "Failed to start disable_ht"
}
stop() {
ebegin "Enabling CPU 1 und 3: "
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu3/online
eend $? "Failed to stop disable_ht"
}
By forcing it to start before gmond, I make ganglia report only 2 CPUs.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=440321 |
|
Back to top |
|
|
frenkel Veteran
Joined: 13 May 2003 Posts: 1034 Location: .nl
|
Posted: Sat May 30, 2009 9:47 pm Post subject: |
|
|
Thanks for the script. I also couldn't get the "noht" option to work. Weird why it is listed as a valid option :S _________________ http://techfield.org |
|
Back to top |
|
|
|