Open the /etc/sysctl. conf file with root permissions and add the line to it manually. Reboot for these changes to take effect. Once again, check your system's allocation of huge pages in the /proc/meminfo virtual file.
Transparent Huge Pages (THP) is a Linux memory management system that reduces the overhead of Translation Lookaside Buffer (TLB) lookups on machines with large amounts of memory by using larger memory pages.
How do I enable transparent huge pages by default on Ubuntu?
~$ uname -a
Linux yoda 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:13:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
~$ cd /sys/kernel/mm/transparent_hugepage/
/sys/kernel/mm/transparent_hugepage$ ls
defrag enabled khugepaged
/sys/kernel/mm/transparent_hugepage$ cat enabled
always [madvise] never
/sys/kernel/mm/transparent_hugepage$ sudo echo always > enabled
-bash: enabled: Permission denied
/sys/kernel/mm/transparent_hugepage$ sudo ls
[sudo] password for <...>:
defrag enabled khugepaged
/sys/kernel/mm/transparent_hugepage$ sudo ls
defrag enabled khugepaged
/sys/kernel/mm/transparent_hugepage$ sudo echo always > enabled
-bash: enabled: Permission denied
/sys/kernel/mm/transparent_hugepage$ cat enabled
always [madvise] never
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With