如何禁用透明大页
程序员文章站
2022-03-16 13:49:57
...
方法一:
缺省启用:[always] --- 表明启用了透明大页
[root@rhel-6 redhat_transparent_hugepage]# cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
[always] madvise never
禁用状态:
[root@rhel-6 redhat_transparent_hugepage]# cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
always madvise [never]
方法二:
[root@rhel-6 redhat_transparent_hugepage]# grep AnonHugePages /proc/meminfo
AnonHugePages: 143360 kB
如果 AnonHugePages > 0 同样表示启用了透明大页;
----如何禁用透明大页:
方法一(优先选择):
在 /etc/grub.conf 中添加一行记录:
transparent_hugepage=never
然后重启
方法二:
配置/etc/rc.local 然后重启服务器:
if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/redhat_transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag
fi
缺省启用:[always] --- 表明启用了透明大页
[root@rhel-6 redhat_transparent_hugepage]# cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
[always] madvise never
禁用状态:
[root@rhel-6 redhat_transparent_hugepage]# cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
always madvise [never]
方法二:
[root@rhel-6 redhat_transparent_hugepage]# grep AnonHugePages /proc/meminfo
AnonHugePages: 143360 kB
如果 AnonHugePages > 0 同样表示启用了透明大页;
----如何禁用透明大页:
方法一(优先选择):
在 /etc/grub.conf 中添加一行记录:
transparent_hugepage=never
然后重启
方法二:
配置/etc/rc.local 然后重启服务器:
if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/redhat_transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag
fi
上一篇: php判断函数中必传参数是否存在