通过配置服务方式
-
-
cat >/etc/systemd/system/disable-thp.service <<!
-
-
[unit]
-
description=disable transparent huge pages (thp)
-
-
[service]
-
type=simple
-
execstart=/bin/sh -c "echo 'never' >/sys/kernel/mm/transparent_hugepage/enabled && echo 'never' >/sys/kernel/mm/transparent_hugepage/defrag"
-
-
[install]
-
wantedby=multi-user.target
-
-
!
-
-
systemctl daemon-reload
-
systemctl start disable-thp
-
systemctl enable disable-thp
-
systemctl status disable-thp
-
实施时,只需用 root 全选,粘贴。
参考:
在 oracle linux 7 上禁用透明 hugepages(文档 id 2336923.1)
阅读(902) | 评论(0) | 转发(0) |