Skip to content

Instantly share code, notes, and snippets.

@flyinprogrammer
Last active December 26, 2017 06:52
Show Gist options
  • Save flyinprogrammer/6e1cdd7cbdd32d607c07a9ed8059dc1e to your computer and use it in GitHub Desktop.
Save flyinprogrammer/6e1cdd7cbdd32d607c07a9ed8059dc1e to your computer and use it in GitHub Desktop.
switch clocksource to tsc on boot - ubuntu 16.04
## Step 1) install/ensure sysfsutils is installed
sudo apt-get install sysfsutils
# ---------------------------------
# Manage /sys filesystem. Requires sysfsutils package
## Turn off THP
sudo tee -a /etc/sysfs.d/thp.conf <<-EOF
kernel/mm/transparent_hugepage/enabled = never
kernel/mm/transparent_hugepage/khugepaged/defrag = 0
kernel/mm/transparent_hugepage/defrag = never
EOF
## Set clocksource to tsc to speed everything up https://www.youtube.com/watch?v=agQMFIWr2h4
sudo tee -a /etc/sysfs.d/clocksource.conf <<-EOF
devices/system/clocksource/clocksource0/current_clocksource = tsc
EOF
# ---------------------------------
sudo systemctl enable sysfsutils.service
sudo systemctl start sysfsutils.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment