vi /etc/systemd/system/disable-thp.service
[Unit] Description=Disable Transparent Huge Pages (THP) DefaultDependencies=no After=sysinit.target local-fs.target [Service] Type=oneshot ExecStart=/bin/sh -c 'echo never | tee /sys/kernel/mm/transparent_hugepage/enabled > /dev/null' [Install] WantedBy=basic.target
systemctl daemon-reload
systemctl start disable-thp
cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
systemctl enable disable-thp
reboot