CPU frequency control
Solution 1:
You can set maximum and minimum frequencies by setting /sys/devices/system/cpu/cpu**N**/cpufreq/scaling_min_freq
and /sys/devices/system/cpu/cpu**N**/cpufreq/scaling_max_freq
Details are described in this document: https://software.intel.com/sites/default/files/comment/1716807/how-to-change-frequency-on-linux-pub.txt
Edit:
You can reach the same using cpufreq-set
in cpufrequtils
package: https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufreq-set.html
Solution 2:
Question 1: How can I manually set the maximum allowed cpu frequency?
For example, to set the maximum frequency to 60 percent of either 3.5 GHz (turbo disabled) or 3.9 GHz (turbo enabled):
echo "60" | sudo tee /sys/devices/system/cpu/intel_pstate/max_perf_pct
Question 2: I see that ALL four cores are constantly at 3.9 ghz, which should [NOT] be impossible. How's that?
They are not all active at the same time. There is only 1 PLL, and all CPUs are always at the same frequency. If you are seeing 3.9GHz, then only 1 CPU was in the C0 state at the time the sample was taken.
Solution 3:
everything mentioned here above works if your kernel has the correct modules loaded :
# CPU frequency control Driver
modprobe acpi_cpufreq
modprobe mperf
# CPU Frequency scaling modules
modprobe cpufreq_conservative
modprobe cpufreq_ondemand
modprobe cpufreq_performance
modprobe cpufreq_powersave
modprobe cpufreq_stats
modprobe cpufreq_userspace
modprobe freq_table