How to keep transparent hugepages config after reboot?

4.8k Views Asked by At

I used the below way to disable transparent hugepages. But they are restored (enabled again) after reboot.

echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag
echo no > /sys/kernel/mm/redhat_transparent_hugepage/khugepaged/defrag

How to keep those modified after reboot?

2

There are 2 best solutions below

0
On

resolved^_^ Add them to the end of /etc/rc.local

0
On

In /etc/grub.conf.
Add:

transparent_hugepage=never 

to the "kernel" line.