Jump to content

R.e the video This BIZARRE Chinese Motherboard has a Graphics Card in it!! Linus hits an error that his CPU scaling governor is going to reduce his performance.

It's probably been addressed before and you can google a lot of information on Linux CPU tuning, one can easily view available scaling governors in Linux:

You'll probably need to be root or run sudo for the following commands:

# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

Scaling governors change how the CPU frequency is scaled during workloads, as the name might imply. My quad core Xeon E3-1220 has powersave or performance, default is powersave. You can just echo the governor type you want into scaling_governor for each cpu:

# for f in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor ; do echo performance > $f ; cat $f; done

Additionally, some extra system tuning I usually do when running performance tests in Linux systems, is to disable Intel C states, which are power saving modes,  setting mwait idle loop which changes how the processor handles low level interrupts, disabling Intel P-states which removes frequency scaling

# vi /etc/default/grub
>>
...
GRUB_CMDLINE_LINUX_DEFAULT="intel_idle.max_cstate=0 processor.max_cstate=0 idle=mwait intel_pstate=disable
...

# update-grub; update-grub2 #For Linux systems

If I'm running a DPDK application I pin it to isolated CPUs, exempt from other kernel tasks. DPDK performance degrades quickly if executed on a CPU with overlapping interrupts so I exclude the chosen CPUs with isol_cpu, disable kernel ticks with nohz_full and finally prevent read-copy-updates (rcu) on the chosen CPUs. For example, if I wanted to completely isolate cpus 2,3 from any other processes I'd add the following to my GRUB_CMDLINE:

>>
GRUB_CMDLINE_LINUX_DEFAULT="... isol_cpus=2,3 nohz_full=2,3 rcu_nocbs=2,3"

Always keep at least 1 non-isolated CPU for housekeeping etc, otherwise your system will be borked and won't boot. Don't forget to update your grub settings or reboot your system to reload your new kernel command line arguments (or use grub-mkconfig if you're on RHEL/Centos).

Link to comment
https://linustechtips.com/topic/1191069-cpu-scaling-governors/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×