Thursday, May 18, 2017

Disabling Transparent Huge Pages on Linux 6 and Linux 7

Oracle recommends that Transparent Huge Pages should be disabled before installation of Oracle software. In the following I will explain how to disable Transparent Huge Pages on Linux 6 and Linux 7. I am using Oracle Enterprise Linux where I see that this feature is already disabled. You can check for your release of Linux whether it is disabled or not, and disable it using method explained here. This is the official document for doing this task.


Check if Transparent Huge Pages is Enabled

For Red Hat Linux, issue following command
# cat /sys/kernel/mm/redhat_transparent_hugepage/enabled

For other Linux distributions, use issue following command
# cat /sys/kernel/mm/transparent_hugepage/enabled

For Red hat, if you don’t see directory “redhat_transparent_hugepage”, and for other distributions, directory “transparent_hugepage” does not exist, it means Transparent Huge Pages is already disabled
If Transparent Huge Pages is enabled, above command should return following output.
[always] never


Disabling Transparent Huge Pages 

Add following entry in /etc/grub.conf file for Linux 6, and /etc/grub2.cfg for Linux 7. This entry needs to be made for every kernel listed in the grub configuration file which you use for booting the system.
transparent_hugepage=never

For example, on my current Oracle Linux 7, I have 3 kernels that I can use to boot my OS, and Transparent huge Pages is already disabled, but you will need to make this entry if entry is not already there. Following are these entries from my server.

menuentry 'Oracle Linux Server, with Linux 3.10.0-123.el7.x86_64' --class oracle --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnul
inux-3.10.0-123.el7.x86_64-advanced-c0c94d8d-4dac-4926-89a1-12f5ae2659f5' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod xfs
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  9ca469b8-017b-498
e-a5af-5b0378ee8b75
        else
          search --no-floppy --fs-uuid --set=root 9ca469b8-017b-498e-a5af-5b0378ee8b75
        fi
        linux16 /vmlinuz-3.10.0-123.el7.x86_64 root=UUID=c0c94d8d-4dac-4926-89a1-12f5ae2659f5 ro vconsole.keymap=us crashkernel=auto vconsole.font=latarcyrheb-sun1
6 rhgb quiet numa=off transparent_hugepage=never
        initrd16 /initramfs-3.10.0-123.el7.x86_64.img
}


menuentry 'Oracle Linux Server, with Unbreakable Enterprise Kernel 3.8.13-35.3.1.el7uek.x86_64' --class oracle --class gnu-linux --class gnu --class os --unrestric
ted $menuentry_id_option 'gnulinux-3.8.13-35.3.1.el7uek.x86_64-advanced-c0c94d8d-4dac-4926-89a1-12f5ae2659f5' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod xfs
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  9ca469b8-017b-498
e-a5af-5b0378ee8b75
        else
          search --no-floppy --fs-uuid --set=root 9ca469b8-017b-498e-a5af-5b0378ee8b75
        fi
        linux16 /vmlinuz-3.8.13-35.3.1.el7uek.x86_64 root=UUID=c0c94d8d-4dac-4926-89a1-12f5ae2659f5 ro vconsole.keymap=us crashkernel=auto vconsole.font=latarcyrhe
b-sun16 rhgb quiet numa=off transparent_hugepage=never
        initrd16 /initramfs-3.8.13-35.3.1.el7uek.x86_64.img
}


menuentry 'Oracle Linux Server, with Linux 0-rescue-f58182a4af154aa38f194b45455927b1' --class oracle --class gnu-linux --class gnu --class os --unrestricted $menue
ntry_id_option 'gnulinux-0-rescue-f58182a4af154aa38f194b45455927b1-advanced-c0c94d8d-4dac-4926-89a1-12f5ae2659f5' {
        load_video
        insmod gzio
        insmod part_msdos
        insmod xfs
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  9ca469b8-017b-498
e-a5af-5b0378ee8b75
        else
          search --no-floppy --fs-uuid --set=root 9ca469b8-017b-498e-a5af-5b0378ee8b75
        fi
        linux16 /vmlinuz-0-rescue-f58182a4af154aa38f194b45455927b1 root=UUID=c0c94d8d-4dac-4926-89a1-12f5ae2659f5 ro vconsole.keymap=us crashkernel=auto vconsole.f
ont=latarcyrheb-sun16 rhgb quiet numa=off transparent_hugepage=never
        initrd16 /initramfs-0-rescue-f58182a4af154aa38f194b45455927b1.img
}


Reboot the server so that changes become effective.

No comments:

Post a Comment

Popular Posts - All Times