您的位置:首页 > 其它

G.2.4 Disabling Transparent HugePages

2018-02-17 13:20 351 查看
参考文档: https://docs.oracle.com/cd/E11882_01/server.112/e10839/appi_vlm.htm#UNXAR411

G.2.4 Disabling Transparent HugePages

Transparent HugePages memory is enabled by default with Red Hat Enterprise Linux 6, SUSE 11, and Oracle Linux 6 with earlier releases of Oracle Linux Unbreakable Enterprise Kernel 2 (UEK2) kernels. Transparent HugePages memory is disabled by default in later releases of UEK2 kernels.Transparent HugePages can cause memory allocation delays at runtime. To avoid performance issues, Oracle recommends that you disable Transparent HugePages on all Oracle Database servers. Oracle recommends that you instead use standard HugePages for enhanced performance.Transparent HugePages memory differs from standard HugePages memory because the kernel 
khugepaged
 thread allocates memory dynamically during runtime. Standard HugePages memory is pre-allocated at startup, and does not change during runtime.To check if Transparent HugePages is enabled run one of the following commands as the 
root
 user:Red Hat Enterprise Linux kernels:# cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
Other kernels:# cat /sys/kernel/mm/transparent_hugepage/enabled
The following is a sample output that shows Transparent HugePages is being used as the 
[always]
 flag is enabled.[always] never
Note:If Transparent HugePages is removed from the kernel then the 
/sys/kernel/mm/transparent_hugepage
 or 
/sys/kernel/mm/redhat_transparent_hugepage
 files do not exist.To disable Transparent HugePages perform the following steps:Add the following entry to the kernel boot line in the 
/etc/grub.conf
 file:transparent_hugepage=never
For example:title Oracle Linux Server (2.6.32-300.25.1.el6uek.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-300.25.1.el6uek.x86_64 ro root=LABEL=/ transparent_hugepage=never
initrd /initramfs-2.6.32-300.25.1.el6uek.x86_64.img
测试:
去掉 transparent_hugepage=never 。这个时候,Transparent HugePages 就是启用的。
[root@test ~]# cat /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/vg_test-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Oracle Linux Server Unbreakable Enterprise Kernel (4.1.12-112.14.1.el6uek.x86_64)
root (hd0,0)
kernel /vmlinuz-4.1.12-112.14.1.el6uek.x86_64 ro root=/dev/mapper/vg_test-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=vg_test/lv_swap SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rd_LVM_LV=vg_test/lv_root rhgb quiet numa=off
initrd /initramfs-4.1.12-112.14.1.el6uek.x86_64.img
title Oracle Linux Server Unbreakable Enterprise Kernel (4.1.12-61.1.28.el6uek.x86_64)
root (hd0,0)
kernel /vmlinuz-4.1.12-61.1.28.el6uek.x86_64 ro root=/dev/mapper/vg_test-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=vg_test/lv_swap SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rd_LVM_LV=vg_test/lv_root rhgb quiet numa=off
initrd /initramfs-4.1.12-61.1.28.el6uek.x86_64.img
title Oracle Linux Server Red Hat Compatible Kernel (2.6.32-696.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-696.el6.x86_64 ro root=/dev/mapper/vg_test-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=vg_test/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rd_LVM_LV=vg_test/lv_root rhgb quiet numa=off
initrd /initramfs-2.6.32-696.el6.x86_64.img
[root@test ~]#
Last login: Sat Feb 17 11:16:33 2018 from 192.168.2.240
[root@test ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never
[root@test ~]#
加上transparent_hugepage=never。 这个时候,Transparent Hugepages就是禁用的了。[root@test ~]# cat /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/vg_test-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Oracle Linux Server Unbreakable Enterprise Kernel (4.1.12-112.14.1.el6uek.x86_64)
root (hd0,0)
kernel /vmlinuz-4.1.12-112.14.1.el6uek.x86_64 ro root=/dev/mapper/vg_test-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=vg_test/lv_swap SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rd_LVM_LV=vg_test/lv_root rhgb quiet numa=off transparent_hugepage=never
initrd /initramfs-4.1.12-112.14.1.el6uek.x86_64.img
title Oracle Linux Server Unbreakable Enterprise Kernel (4.1.12-61.1.28.el6uek.x86_64)
root (hd0,0)
kernel /vmlinuz-4.1.12-61.1.28.el6uek.x86_64 ro root=/dev/mapper/vg_test-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=vg_test/lv_swap SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rd_LVM_LV=vg_test/lv_root rhgb quiet numa=off transparent_hugepage=never
initrd /initramfs-4.1.12-61.1.28.el6uek.x86_64.img
title Oracle Linux Server Red Hat Compatible Kernel (2.6.32-696.el6.x86_64)
root (hd
afe9
0,0)
kernel /vmlinuz-2.6.32-696.el6.x86_64 ro root=/dev/mapper/vg_test-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=vg_test/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rd_LVM_LV=vg_test/lv_root rhgb quiet numa=off transparent_hugepage=never
initrd /initramfs-2.6.32-696.el6.x86_64.img
[root@test ~]#
[root@test ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
[root@test ~]#
END 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: