Disabling Transparent Hugepages (THP) in RHEL 6

Moderator: cah

Post Reply
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

Disabling Transparent Hugepages (THP) in RHEL 6

Post by cah »

During vFlash testing on laxm1781, the server became unresponsive with high IO await and CPU load and I opened a case with Red Hat. The engineer came back and said we have THP enabled. After checking SAP notes, it confirmed THP is not a good idea and we decided to disable it.

The recommended way of disabling THP is put "transparent_hugepage=never" in grub.conf and any future reboots will disable THP.
Example, adding "transparent_hugepage=never" to /boot/grub/grub.conf for kernel:

Code: Select all

kernel /vmlinuz-2.6.32-504.8.1.el6.x86_64 ro root=/dev/mapper/rootvg-LogVol00 rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=rootvg/LogVol00 rd_LVM_LV=rootvg/LogVol01 rd_NO_MD SYSFONT=latarcyrheb-sun16  KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet rd_NO_DM rhgb quiet elevator=noop transparent_hugepage=never
We can also change it on the fly without the need to reboot it.
Check current status:

Code: Select all

# cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never
It shows "always" but we want "never".

Run the following commands to disable:

Code: Select all

if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
   echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
   echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
Check the status again:

Code: Select all

cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
It changed from [always] to [never].
CAH, The Great
Post Reply