1.在GRUB_CMDLINE_LINUX加入选项 transparent_hugepage=never

echo 'GRUB_CMDLINE_LINUX="transparent_hugepage=never"' >>  /etc/default/grub

2.重新生成grub文件

#grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-693.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-bdd94cf792bd4ac6a087ff2542ba6cd0
Found initrd image: /boot/initramfs-0-rescue-bdd94cf792bd4ac6a087ff2542ba6cd0.img
done

#grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-693.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-bdd94cf792bd4ac6a087ff2542ba6cd0
Found initrd image: /boot/initramfs-0-rescue-bdd94cf792bd4ac6a087ff2542ba6cd0.img
done

3.重启操作系统

reboot

4.验证是否关闭透明大页

# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-693.el7.x86_64 root=/dev/mapper/rhel-root ro transparent_hugepage=never
#grep Huge /proc/meminfo
AnonHugePages: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB