Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
## Set clocksource to tsc to speed everything up
sudo tee -a /etc/sysfs.d/clocksource.conf <<-EOF
devices/system/clocksource/clocksource0/current_clocksource = tsc
# ---------------------------------
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