How to disable transparent hugepages (THP) on Red Hat Enterprise Linux 7
原文网址:
https://access.redhat.com/solutions/1320153
环境
- Red Hat Enterprise Linux 7
- transparent hugepages (THP)
- tuned
问题
- How to disable transparent hugepages (THP) on Red Hat Enterprise Linux 7
- Disabling transparent hugepages (THP) on Red Hat Enterprise Linux 7 is not taking effect.
决议
Follow the steps below
Add the "transparent_hugepage=never" kernel parameter option to the grub2 configuration file.
Append or change the "transparent_hugepage=never" kernel parameter on the GRUB_CMDLINE_LINUX option in
/etc/default/grubfile. Only include the parameter once.GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap ... transparent_hugepage=never"
Rebuild the
/boot/grub2/grub.cfgfile by running the grub2-mkconfig -o command as follows:- Please ensure to take a backup of the existing
/boot/grub2/grub.cfgbefore rebuilding.- On BIOS-based machines:
~]# grub2-mkconfig -o /boot/grub2/grub.cfg - On UEFI-based machines:
~]# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
- On BIOS-based machines:
- Please ensure to take a backup of the existing
Reboot the system and verify option has been added
Reboot the system
# shutdown -r nowVerify the parameter is set correctly
# cat /proc/cmdline
If Transparent Huge Pages (THP) is still not disabled, continue and use one of the options below.
Option 1: (Recommended) create a customized tuned profile with disabled THP
- With this resolution we will create a customized version of the currently running profile. The customized version will disable THP.
Find out which profile is active, create a copy. In the following example we currently use the
throughput-performanceprofile:# tuned-adm active Current active profile: throughput-performanceTo create customized profile, create a new directory in
/etc/tuneddirectory with desired profile name.# mkdir /etc/tuned/myprofile-nothpThen create a new tuned.conf file for myprofile-nothp, and insert the new tuning info:
# cat /etc/tuned/myprofile-nothp/tuned.conf [main] include= throughput-performance [vm] transparent_hugepages=neverMake the script executable:
# chmod +x /etc/tuned/myprofile-nothp/tuned.confEnable myprofile like so:
# tuned-adm profile myprofile-nothpThis change will immediately take effect and persist reboots.
To verify if THP are disabled or not, run below command:
# cat /sys/kernel/mm/transparent_hugepage/enabled
Option 2: (Alternative) Disable tuned services
This resolution will disable the tuned services.
# systemctl stop tuned # systemctl disable tunedOR
# tuned-adm offNow add "transparent_hugepage=never" kernel parameter in grub2 configuration file as explained in steps 1-3 above.
- Reboot the server for changes to take effect.
本文介绍如何在Red Hat Enterprise Linux 7上禁用透明大页(THP),包括通过内核参数设置、定制tuned配置文件及停用tuned服务等方法。
1181

被折叠的 条评论
为什么被折叠?



