Transparent HugePages Settings
Note
|
These settings are only applicable to using Azul Zing Builds of OpenJDK (Zing) with Azul Zing System Tools (ZST). |
If your operating system supports Transparent HugePages (THP), the THP feature must be turned off. For RHEL systems, see https://access.redhat.com/site/solutions/422283.
To disable Transparent HugePages on RHEL, SUSE, and Ubuntu systems:
-
Check the current HugePage setting.
# cat /sys/kernel/mm/transparent_hugepage/enabledSample response:
[always] madvise never -
Open the grub configuration file for editing.
-
For RHEL:
/boot/grub/grub.conf
-
For SLES:
/boot/grub/menu.1st
-
For Ubuntu:
/etc/default/grub
-
-
Add
transparent_hugepage=never
to the kernel boot line, for example:title Red Hat Enterprise Linux Server (2.6.32-431.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/vg_qaesp3-lv_root rd_LVM_LV=vg_qaesp3 /lv_root rd_LVM_LV=vg_qaesp3/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb- sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet transparent_hugepage=never initrd /initramfs-2.6.32-431.el6.x86_64.img -
Reboot the server. This is required to have the change take effect.
-
Check the change is applied after reboot.
# cat /sys/kernel/mm/transparent_hugepage/enabled always madvise [never]
On RHEL/CentOS 7.x systems:
Follow the below steps to add the transparent_hugepage=never
kernel parameter in grub configuration file:
-
Append or change the
transparent_hugepage=never
kernel parameter on theGRUB_CMDLINE_LINUX
option in/etc/sysconfig/grub file
. Save the file. For example:GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap vconsole.font=latarcyrheb-sun16 vconsole.keymap=us transparent_hugepage=never" -
Run the
grub2-mkconfig
command to regenerate thegrub.cfg
file. For example:sudo grub2-mkconfig -o /boot/grub2/grub.cfg -
Reboot the system and ensure that the parameter is set correctly:
sudo cat /proc/cmdline
If THP are still not disabled, then continue with below steps:
-
Create a customized tuned profile with disabled THP. The customized version will disable THP. Find out which profile is active and create a copy. In the following example we currently use the
throughput-performance
profile:$ sudo tuned-adm active Current active profile: throughput-performance -
To create customized profile, create a new directory in
/etc/tuned
directory with desired profile name. For example,sudo mkdir /etc/tuned/myprofile-nothp -
Create a new
tuned.conf
file formyprofile-nothp
, and insert the new tuning info. For example,$ sudo cat /etc/tuned/myprofile-nothp/tuned.conf [main] include= throughput-performance [vm] transparent_hugepages=never -
Make the script executable:
sudo chmod +x /etc/tuned/myprofile-nothp/tuned.conf -
Enable
myprofile
:sudo tuned-adm profile myprofile-nothp
This change will immediately take effect and persist reboots. To verify if THP are disabled or not, run the following command:
sudo cat /sys/kernel/mm/transparent_hugepage/enabled
Alternatively, disable the tuned services. For example:
sudo systemctl stop tuned
sudo systemctl disable tuned
Or
sudo tuned-adm off
Now add transparent_hugepage=never
kernel parameter in grub configuration file as explained in above first method and reboot the server for changes to take effect.