10

如何在 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
4

3 回答 3

21

添加以下内容:

transparent_hugepage=always

到您的 GRUB_CMDLINE_LINUX_DEFAULT:

/etc/default/grub

并做一个:

update-grub

应该做的伎俩。

于 2013-09-06T07:04:15.047 回答
5
sudo su
password: [....]
echo always > /sys/kernel/mm/transparent_hugepage/enabled 
于 2014-08-08T16:13:32.433 回答
1

将此添加到您的 /etc/rc.local:

echo always > /sys/kernel/mm/transparent_hugepage/enabled

于 2015-03-06T17:55:47.987 回答