By default, most Linux distributions will now enable kernel level mitigations for CPU bugs such as the infamous meltdown and spectre. These mitigations are extremely important for the use of running untrusted code (e.g. cloud VMs), but are less relavent for personal computers, who generally control what is being executed.
The mitigations will impact performance, especially for workloads that incur context switching. In particular, developers are highly impacted, since our build tools are all reading and writing files to/from disk, for tasks from compilation to code auto-completion. There is room for noticible performance improvement by disabling mitigations.
Beware of the implications, and disable mitigations at your own risk.
/etc/default/grub file to include the
mitigations=off linux boot parameter.
$ cat /etc/default/grub | grep GRUB_CMDLINE_LINUX_DEFAULT GRUB_CMDLINE_LINUX_DEFAULT="quiet splash mitigations=off"
apply the changes to grub by running
$ sudo update-grub Sourcing file `/etc/default/grub' Sourcing file `/etc/default/grub.d/init-select.cfg' Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.4.0-31-generic Found initrd image: /boot/initrd.img-5.4.0-31-generic Found linux image: /boot/vmlinuz-5.4.0-26-generic Found initrd image: /boot/initrd.img-5.4.0-26-generic Found memtest86+ image: /boot/memtest86+.elf Found memtest86+ image: /boot/memtest86+.bin done
reboot to pickup the changes
$ sudo reboot
a quick grep on
dmesg to see the kernel parameter got set
$ dmesg | grep 'BOOT_IMAGE' [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-31-generic root=UUID=f0852c92-2b33-4bea-a689-dc519810d080 ro quiet splash mitigations=off vt.handoff=7 [ 0.078788] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-31-generic root=UUID=f0852c92-2b33-4bea-a689-dc519810d080 ro quiet splash mitigations=off vt.handoff=7