Add the permanent approach for setting THP

This commit is contained in:
peter279k 2024-02-26 15:44:53 +08:00 committed by Peter
parent 07c828ece9
commit 16a9a8cdf1
No known key found for this signature in database
GPG Key ID: CFF8BB30B2E6D6FD

View File

@ -111,6 +111,14 @@ On newer Linux kernels transparent huge pages are alright.
$ echo 'madvise' | sudo tee /sys/kernel/mm/transparent_hugepage/enabled $ echo 'madvise' | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
``` ```
If you want to modify the transparent huge pages setting permanently, editing the `/etc/default/grub` to add the `transparent_hugepage=never` to the `GRUB_CMDLINE_LINUX_DEFAULT` option:
```bash
$ GRUB_CMDLINE_LINUX_DEFAULT="transparent_hugepage=madvise ..."
```
After that, run the `sudo update-grub` command then reboot to take effect.
## Hypervisor configuration ## Hypervisor configuration
If you are using OpenStack, set If you are using OpenStack, set