[转]如何关闭Linux环境下的超线程

今天同事遇到了这问题来问俺,给出了下面的参考资料,分享大家。

 

转自:http://www.cyberciti.biz/faq/linux-disable-hyper-threading-for-pentium-4-server-grub-boot-loader/

 

Linux Disable Hyper Threading for Pentium 4 server GRUB boot loader

 

Q. I am using GRUB boot loader. How do I disable Hyper Threading for Pentium 4 server? I am using CentOS.

A. To improve performance in the past, threading was enabled in the software by splitting instructions into multiple streams so that multiple processors could act upon them. Hyper-Threading Technology (HT Technology) provides thread-level parallelism on each processor, resulting in more efficient use of processor resources, higher processing throughput, and improved performance on today's multithreaded software.

If you disable HT you may notice performance problem. To disable edit grub.conf file:
# vi /etc/grub.conf
OR
# vi /boot/grub/menu.lst

Locate the kernel line that you want to modify and append noht at the end:
kernel /boot/vmlinuz-2.6.8-2-686 root=/dev/hdb1 ro single noht

Save and close the file.

You can also disable HT during booting CentOS Linux. You need to pass an option to kernel.

  1. At GRUB menu
  2. Select the kernel to boot into.
  3. Type 'e ' to modify the kernel
  4. Append 'noht ' at the end of the line.
  5. Press return key to boot with this options.
  6. Type 'b ' to boot to this kernel.

 

 

你可能感兴趣的:(Linux平台应用技术)