Transparent Hugepage is not getting disabled (Doc ID 2279458.1)

本文介绍了解决Linux系统中无法禁用透明大页的问题。通过调整grub配置文件及停用相关服务,确保系统启动时不激活透明大页功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Transparent Hugepage is not getting disabled (Doc ID 2279458.1)To BottomTo Bottom

In this Document

 Symptoms
 Cause
 Solution
 References

 

APPLIES TO:

Linux OS - Version Oracle Linux 6.8 with Unbreakable Enterprise Kernel [4.1.12] and later
Information in this document applies to any platform.

SYMPTOMS

Trying to disable transparent hugepages. Made the following entries:

/etc/grub.conf

kernel /vmlinuz-2.6.32-642.3.1.el6.x86_64 ro root=/dev/mapper/vg_ho02db02-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=vg_ho02db02/lv_swap rd_LVM_LV=vg_ho02db02/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet numa=off transparent_hugepage=never fnic.fnic_max_qdepth=256

 

/etc/rc.d/rc.local:
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

Even though the changes have been made the system still shows hugepage is active

CAUSE

The ktune service enables transparent_hugepages by default for all profiles hence anytime a tuned profile is enabled at bootup or manually transparent huge pages gets re-enabled.
 
The below file states the cause of the hugepage getting enabled always even though it is set to never in grub.conf file
/etc/tune-profiles/enterprise-storage/ktune.sh

#!/bin/sh

. /etc/tune-profiles/functions

start() {
  set_cpu_governor performance
  set_transparent_hugepages always ---->>>> set transparent_hugepages always
  disable_disk_barriers
  multiply_disk_readahead 4

  return 0
}

stop() {
  [ "$1" != "restart" ] && restore_cpu_governor
  restore_transparent_hugepages
  enable_disk_barriers
  restore_disk_readahead

  return 0
}

process $@ 

SOLUTION

#service tuned stop
#chkconfig tuned off
#service ktune stop
#chkconfig ktune off


Append transparent_hugepage=never to kernel command line in /boot/grub/grub.conf file

/etc/grub.conf:
...
kernel /vmlinuz-2.6.32-642.3.1.el6.x86_64 ro root=/dev/mapper/vg_ho02db02-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=vg_ho02db02/lv_swap rd_LVM_LV=vg_ho02db02/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet numa=off transparent_hugepage=never  fnic.fnic_max_qdepth=256
...

Reboot the server and check if  /sys/kernel/mm/transparent_hugepage/enabled changed

#cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值