After upgrade to 18.04, cpufreq scales all CPUs in unison rather than individually











up vote
0
down vote

favorite












I have an Intel i7-6900K, 8 cores/16 hyper threads.



I have conky running on my desktop and it shows each of the 8 hardware core clock rates. Prior to the upgrade to 18.04 (from 16.04), each core scaled individually and the "on demand" policy seemed to work well, with a core increased to turbo speed under load (for example a single thread working hard) and the other cores staying throttled. Under 18.04, the cores appear to ramp up and down in parallel.



The policies available in 18.04 are "Performance" and "On demand". With the "Performance" policy active, which is the default after the upgrade, all of the cores stay above the base frequency of 3.2Ghz at around 3.45-3.53Ghz. I can enable the "On demand" policy by enabling the service via systemctl and rebooting. But then all the cores stay in around the 2.5Ghz level or so, and even under sustained load, none of the cores scale all the way up.



Under 16.04, the cores stayed at a relatively low clock speed and then scaled up almost instantly under load individually.



The situation is rather confusing now, as much of the documentation online doesn't apply to newer processors and/or newer kernels. More confusing is that one could use ACPI to control CPU clock frequency.



Is there a guide anywhere that has all or some of the following information:




  • Which processors should be covered by which scaling methods in Linux?

  • What mechanisms are available (cpufreq, ACPI, neither, something else)

  • How to accurately read current CPU speed. For example, one might thinkg that "cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq" would be accurate, but the documentation says it may not be accurate:


"In the majority of cases, this is the frequency of the last P-state requested by the scaling driver from the hardware using the scaling interface provided by it, which may or may not reflect the frequency the CPU is actually running at (due to hardware design and other limitations)"



Thanks for any help. I'll attempt to double check and document all the information that I collect and post it somewhere.










share|improve this question






















  • FYI, this doc sheds some light: access.redhat.com/documentation/en-us/red_hat_enterprise_linux/…
    – rabinnh
    Nov 26 at 14:04















up vote
0
down vote

favorite












I have an Intel i7-6900K, 8 cores/16 hyper threads.



I have conky running on my desktop and it shows each of the 8 hardware core clock rates. Prior to the upgrade to 18.04 (from 16.04), each core scaled individually and the "on demand" policy seemed to work well, with a core increased to turbo speed under load (for example a single thread working hard) and the other cores staying throttled. Under 18.04, the cores appear to ramp up and down in parallel.



The policies available in 18.04 are "Performance" and "On demand". With the "Performance" policy active, which is the default after the upgrade, all of the cores stay above the base frequency of 3.2Ghz at around 3.45-3.53Ghz. I can enable the "On demand" policy by enabling the service via systemctl and rebooting. But then all the cores stay in around the 2.5Ghz level or so, and even under sustained load, none of the cores scale all the way up.



Under 16.04, the cores stayed at a relatively low clock speed and then scaled up almost instantly under load individually.



The situation is rather confusing now, as much of the documentation online doesn't apply to newer processors and/or newer kernels. More confusing is that one could use ACPI to control CPU clock frequency.



Is there a guide anywhere that has all or some of the following information:




  • Which processors should be covered by which scaling methods in Linux?

  • What mechanisms are available (cpufreq, ACPI, neither, something else)

  • How to accurately read current CPU speed. For example, one might thinkg that "cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq" would be accurate, but the documentation says it may not be accurate:


"In the majority of cases, this is the frequency of the last P-state requested by the scaling driver from the hardware using the scaling interface provided by it, which may or may not reflect the frequency the CPU is actually running at (due to hardware design and other limitations)"



Thanks for any help. I'll attempt to double check and document all the information that I collect and post it somewhere.










share|improve this question






















  • FYI, this doc sheds some light: access.redhat.com/documentation/en-us/red_hat_enterprise_linux/…
    – rabinnh
    Nov 26 at 14:04













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have an Intel i7-6900K, 8 cores/16 hyper threads.



I have conky running on my desktop and it shows each of the 8 hardware core clock rates. Prior to the upgrade to 18.04 (from 16.04), each core scaled individually and the "on demand" policy seemed to work well, with a core increased to turbo speed under load (for example a single thread working hard) and the other cores staying throttled. Under 18.04, the cores appear to ramp up and down in parallel.



The policies available in 18.04 are "Performance" and "On demand". With the "Performance" policy active, which is the default after the upgrade, all of the cores stay above the base frequency of 3.2Ghz at around 3.45-3.53Ghz. I can enable the "On demand" policy by enabling the service via systemctl and rebooting. But then all the cores stay in around the 2.5Ghz level or so, and even under sustained load, none of the cores scale all the way up.



Under 16.04, the cores stayed at a relatively low clock speed and then scaled up almost instantly under load individually.



The situation is rather confusing now, as much of the documentation online doesn't apply to newer processors and/or newer kernels. More confusing is that one could use ACPI to control CPU clock frequency.



Is there a guide anywhere that has all or some of the following information:




  • Which processors should be covered by which scaling methods in Linux?

  • What mechanisms are available (cpufreq, ACPI, neither, something else)

  • How to accurately read current CPU speed. For example, one might thinkg that "cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq" would be accurate, but the documentation says it may not be accurate:


"In the majority of cases, this is the frequency of the last P-state requested by the scaling driver from the hardware using the scaling interface provided by it, which may or may not reflect the frequency the CPU is actually running at (due to hardware design and other limitations)"



Thanks for any help. I'll attempt to double check and document all the information that I collect and post it somewhere.










share|improve this question













I have an Intel i7-6900K, 8 cores/16 hyper threads.



I have conky running on my desktop and it shows each of the 8 hardware core clock rates. Prior to the upgrade to 18.04 (from 16.04), each core scaled individually and the "on demand" policy seemed to work well, with a core increased to turbo speed under load (for example a single thread working hard) and the other cores staying throttled. Under 18.04, the cores appear to ramp up and down in parallel.



The policies available in 18.04 are "Performance" and "On demand". With the "Performance" policy active, which is the default after the upgrade, all of the cores stay above the base frequency of 3.2Ghz at around 3.45-3.53Ghz. I can enable the "On demand" policy by enabling the service via systemctl and rebooting. But then all the cores stay in around the 2.5Ghz level or so, and even under sustained load, none of the cores scale all the way up.



Under 16.04, the cores stayed at a relatively low clock speed and then scaled up almost instantly under load individually.



The situation is rather confusing now, as much of the documentation online doesn't apply to newer processors and/or newer kernels. More confusing is that one could use ACPI to control CPU clock frequency.



Is there a guide anywhere that has all or some of the following information:




  • Which processors should be covered by which scaling methods in Linux?

  • What mechanisms are available (cpufreq, ACPI, neither, something else)

  • How to accurately read current CPU speed. For example, one might thinkg that "cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq" would be accurate, but the documentation says it may not be accurate:


"In the majority of cases, this is the frequency of the last P-state requested by the scaling driver from the hardware using the scaling interface provided by it, which may or may not reflect the frequency the CPU is actually running at (due to hardware design and other limitations)"



Thanks for any help. I'll attempt to double check and document all the information that I collect and post it somewhere.







18.04 intel cpufreq






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 26 at 13:45









rabinnh

32




32












  • FYI, this doc sheds some light: access.redhat.com/documentation/en-us/red_hat_enterprise_linux/…
    – rabinnh
    Nov 26 at 14:04


















  • FYI, this doc sheds some light: access.redhat.com/documentation/en-us/red_hat_enterprise_linux/…
    – rabinnh
    Nov 26 at 14:04
















FYI, this doc sheds some light: access.redhat.com/documentation/en-us/red_hat_enterprise_linux/…
– rabinnh
Nov 26 at 14:04




FYI, this doc sheds some light: access.redhat.com/documentation/en-us/red_hat_enterprise_linux/…
– rabinnh
Nov 26 at 14:04










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










The main thing for your processor is that there is only one Phase Locked Loop (PLL - which scales the CPU clock up and down) in the processor package. Therefore it has always been the case that the CPUs scale up and down in unision. The reason it used to seem different was that the acpi-cpufreq CPU scaling driver used to report what it thought the CPU frequencies should be rather than what they actually were. Now it reports what the frequencies actually are.



For almost all users / scenarios using cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq provides a good enough indicator as to what the individual CPU frequencies are. The reason the document has that disclaimer line it that it is possible that the information can be a little stale if a CPU has been idle with its clock stopped for awhile.



By default your processor should be using the intel-pstate CPU frequency driver and it has HWP (Hardware pstate control), meaning the processor itself can decide the requested pstate (CPU frequency). Note that all pstate requests to go into the PLL stuff, along with idle states and a decision is made as to at what pstate the PLL will operate. You seem to be using the acpi-cpufreq CPU scaling driver, so I guess you have disabled the intel_pstate driver, which is fine, if that is your preference.



As for CPU frequency scaling tools / methods. I never use them. I only manage CPU frequency scaling with the basic primitive commands via the command line.



As to why your CPUs do not seem to go into the turbo range now, we would need more information to provide help. Starting with, for example:



doug@s15:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/scaling_driver
/sys/devices/system/cpu/cpufreq/policy0/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy1/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy2/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy3/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy4/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy5/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy6/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy7/scaling_driver:intel_pstate
doug@s15:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
/sys/devices/system/cpu/cpufreq/policy0/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy1/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy2/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy3/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy4/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy5/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy6/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy7/scaling_governor:powersave
doug@s15:~$ grep . /sys/devices/system/cpu/intel_pstate/* <<<< If driver is intel-pstate.
/sys/devices/system/cpu/intel_pstate/max_perf_pct:100
/sys/devices/system/cpu/intel_pstate/min_perf_pct:42
/sys/devices/system/cpu/intel_pstate/no_turbo:0
/sys/devices/system/cpu/intel_pstate/num_pstates:23
/sys/devices/system/cpu/intel_pstate/status:active
/sys/devices/system/cpu/intel_pstate/turbo_pct:18


Anticipated question: If there is only one PLL, and all CPU always operate at the same frequency, then why are different frequencies reported for them? Example:



doug@s15:~$ cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq
2186018
2315657
2308037
2254830
2111971
2127314
2169466
2152378


Answer: In any given measurement interval, the CPUs are also going into and out of various idle states, where, if the idle state is deep enough, the CPU clock is stopped. The reported frequency is the average active frequency for that processor over the last measurement interval.






share|improve this answer























  • I've looked at the "scaling_cur_freq" values but couldn't reconcile them with other reported frequencies. Thank you very much. This pretty much confirms my suspicions, and I was looking for an authoritative answer. Someone needs to pin this answer.
    – rabinnh
    Nov 26 at 19:23












  • For anyone else that might stumble on this - I had 2 other issues due to upgrading older versions of Ubuntu. The "cpufreqd" init.d service was installed and conflicting with the systemd "ondemand" service. So I purged that. I tracked it down because the hardware had a min freq of 1.2Ghz and a max of 4.0Ghz but the policy was min 4.0Ghz and max 4.0Ghz. When I manually change the minimum (i.e. echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq) and restarted the systemctl ondemand service everything worked, so I knew something else was interfering.
    – rabinnh
    Nov 26 at 20:35












  • @rabinnh: If you liked my answer then please accept it. You only fixed the minimum frequency for CPU 0, you needed to fix it for all CPUs. As root: for file in /sys/devices/system/cpu/cpufreq/policy*/scaling_min_freq; do echo "1200000" > $file; done.
    – Doug Smythies
    Nov 26 at 22:26










  • OP may not have accepted answer but I liked it and up-voted it :)
    – WinEunuuchs2Unix
    Nov 27 at 2:27










  • Sorry, accepted it. Yes, I did it for all CPUs which is how I discovered the old service which was making the minimum frequency the same as the maximum.
    – rabinnh
    Nov 27 at 11:35











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1096177%2fafter-upgrade-to-18-04-cpufreq-scales-all-cpus-in-unison-rather-than-individual%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










The main thing for your processor is that there is only one Phase Locked Loop (PLL - which scales the CPU clock up and down) in the processor package. Therefore it has always been the case that the CPUs scale up and down in unision. The reason it used to seem different was that the acpi-cpufreq CPU scaling driver used to report what it thought the CPU frequencies should be rather than what they actually were. Now it reports what the frequencies actually are.



For almost all users / scenarios using cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq provides a good enough indicator as to what the individual CPU frequencies are. The reason the document has that disclaimer line it that it is possible that the information can be a little stale if a CPU has been idle with its clock stopped for awhile.



By default your processor should be using the intel-pstate CPU frequency driver and it has HWP (Hardware pstate control), meaning the processor itself can decide the requested pstate (CPU frequency). Note that all pstate requests to go into the PLL stuff, along with idle states and a decision is made as to at what pstate the PLL will operate. You seem to be using the acpi-cpufreq CPU scaling driver, so I guess you have disabled the intel_pstate driver, which is fine, if that is your preference.



As for CPU frequency scaling tools / methods. I never use them. I only manage CPU frequency scaling with the basic primitive commands via the command line.



As to why your CPUs do not seem to go into the turbo range now, we would need more information to provide help. Starting with, for example:



doug@s15:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/scaling_driver
/sys/devices/system/cpu/cpufreq/policy0/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy1/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy2/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy3/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy4/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy5/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy6/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy7/scaling_driver:intel_pstate
doug@s15:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
/sys/devices/system/cpu/cpufreq/policy0/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy1/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy2/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy3/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy4/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy5/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy6/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy7/scaling_governor:powersave
doug@s15:~$ grep . /sys/devices/system/cpu/intel_pstate/* <<<< If driver is intel-pstate.
/sys/devices/system/cpu/intel_pstate/max_perf_pct:100
/sys/devices/system/cpu/intel_pstate/min_perf_pct:42
/sys/devices/system/cpu/intel_pstate/no_turbo:0
/sys/devices/system/cpu/intel_pstate/num_pstates:23
/sys/devices/system/cpu/intel_pstate/status:active
/sys/devices/system/cpu/intel_pstate/turbo_pct:18


Anticipated question: If there is only one PLL, and all CPU always operate at the same frequency, then why are different frequencies reported for them? Example:



doug@s15:~$ cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq
2186018
2315657
2308037
2254830
2111971
2127314
2169466
2152378


Answer: In any given measurement interval, the CPUs are also going into and out of various idle states, where, if the idle state is deep enough, the CPU clock is stopped. The reported frequency is the average active frequency for that processor over the last measurement interval.






share|improve this answer























  • I've looked at the "scaling_cur_freq" values but couldn't reconcile them with other reported frequencies. Thank you very much. This pretty much confirms my suspicions, and I was looking for an authoritative answer. Someone needs to pin this answer.
    – rabinnh
    Nov 26 at 19:23












  • For anyone else that might stumble on this - I had 2 other issues due to upgrading older versions of Ubuntu. The "cpufreqd" init.d service was installed and conflicting with the systemd "ondemand" service. So I purged that. I tracked it down because the hardware had a min freq of 1.2Ghz and a max of 4.0Ghz but the policy was min 4.0Ghz and max 4.0Ghz. When I manually change the minimum (i.e. echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq) and restarted the systemctl ondemand service everything worked, so I knew something else was interfering.
    – rabinnh
    Nov 26 at 20:35












  • @rabinnh: If you liked my answer then please accept it. You only fixed the minimum frequency for CPU 0, you needed to fix it for all CPUs. As root: for file in /sys/devices/system/cpu/cpufreq/policy*/scaling_min_freq; do echo "1200000" > $file; done.
    – Doug Smythies
    Nov 26 at 22:26










  • OP may not have accepted answer but I liked it and up-voted it :)
    – WinEunuuchs2Unix
    Nov 27 at 2:27










  • Sorry, accepted it. Yes, I did it for all CPUs which is how I discovered the old service which was making the minimum frequency the same as the maximum.
    – rabinnh
    Nov 27 at 11:35















up vote
1
down vote



accepted










The main thing for your processor is that there is only one Phase Locked Loop (PLL - which scales the CPU clock up and down) in the processor package. Therefore it has always been the case that the CPUs scale up and down in unision. The reason it used to seem different was that the acpi-cpufreq CPU scaling driver used to report what it thought the CPU frequencies should be rather than what they actually were. Now it reports what the frequencies actually are.



For almost all users / scenarios using cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq provides a good enough indicator as to what the individual CPU frequencies are. The reason the document has that disclaimer line it that it is possible that the information can be a little stale if a CPU has been idle with its clock stopped for awhile.



By default your processor should be using the intel-pstate CPU frequency driver and it has HWP (Hardware pstate control), meaning the processor itself can decide the requested pstate (CPU frequency). Note that all pstate requests to go into the PLL stuff, along with idle states and a decision is made as to at what pstate the PLL will operate. You seem to be using the acpi-cpufreq CPU scaling driver, so I guess you have disabled the intel_pstate driver, which is fine, if that is your preference.



As for CPU frequency scaling tools / methods. I never use them. I only manage CPU frequency scaling with the basic primitive commands via the command line.



As to why your CPUs do not seem to go into the turbo range now, we would need more information to provide help. Starting with, for example:



doug@s15:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/scaling_driver
/sys/devices/system/cpu/cpufreq/policy0/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy1/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy2/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy3/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy4/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy5/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy6/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy7/scaling_driver:intel_pstate
doug@s15:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
/sys/devices/system/cpu/cpufreq/policy0/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy1/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy2/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy3/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy4/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy5/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy6/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy7/scaling_governor:powersave
doug@s15:~$ grep . /sys/devices/system/cpu/intel_pstate/* <<<< If driver is intel-pstate.
/sys/devices/system/cpu/intel_pstate/max_perf_pct:100
/sys/devices/system/cpu/intel_pstate/min_perf_pct:42
/sys/devices/system/cpu/intel_pstate/no_turbo:0
/sys/devices/system/cpu/intel_pstate/num_pstates:23
/sys/devices/system/cpu/intel_pstate/status:active
/sys/devices/system/cpu/intel_pstate/turbo_pct:18


Anticipated question: If there is only one PLL, and all CPU always operate at the same frequency, then why are different frequencies reported for them? Example:



doug@s15:~$ cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq
2186018
2315657
2308037
2254830
2111971
2127314
2169466
2152378


Answer: In any given measurement interval, the CPUs are also going into and out of various idle states, where, if the idle state is deep enough, the CPU clock is stopped. The reported frequency is the average active frequency for that processor over the last measurement interval.






share|improve this answer























  • I've looked at the "scaling_cur_freq" values but couldn't reconcile them with other reported frequencies. Thank you very much. This pretty much confirms my suspicions, and I was looking for an authoritative answer. Someone needs to pin this answer.
    – rabinnh
    Nov 26 at 19:23












  • For anyone else that might stumble on this - I had 2 other issues due to upgrading older versions of Ubuntu. The "cpufreqd" init.d service was installed and conflicting with the systemd "ondemand" service. So I purged that. I tracked it down because the hardware had a min freq of 1.2Ghz and a max of 4.0Ghz but the policy was min 4.0Ghz and max 4.0Ghz. When I manually change the minimum (i.e. echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq) and restarted the systemctl ondemand service everything worked, so I knew something else was interfering.
    – rabinnh
    Nov 26 at 20:35












  • @rabinnh: If you liked my answer then please accept it. You only fixed the minimum frequency for CPU 0, you needed to fix it for all CPUs. As root: for file in /sys/devices/system/cpu/cpufreq/policy*/scaling_min_freq; do echo "1200000" > $file; done.
    – Doug Smythies
    Nov 26 at 22:26










  • OP may not have accepted answer but I liked it and up-voted it :)
    – WinEunuuchs2Unix
    Nov 27 at 2:27










  • Sorry, accepted it. Yes, I did it for all CPUs which is how I discovered the old service which was making the minimum frequency the same as the maximum.
    – rabinnh
    Nov 27 at 11:35













up vote
1
down vote



accepted







up vote
1
down vote



accepted






The main thing for your processor is that there is only one Phase Locked Loop (PLL - which scales the CPU clock up and down) in the processor package. Therefore it has always been the case that the CPUs scale up and down in unision. The reason it used to seem different was that the acpi-cpufreq CPU scaling driver used to report what it thought the CPU frequencies should be rather than what they actually were. Now it reports what the frequencies actually are.



For almost all users / scenarios using cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq provides a good enough indicator as to what the individual CPU frequencies are. The reason the document has that disclaimer line it that it is possible that the information can be a little stale if a CPU has been idle with its clock stopped for awhile.



By default your processor should be using the intel-pstate CPU frequency driver and it has HWP (Hardware pstate control), meaning the processor itself can decide the requested pstate (CPU frequency). Note that all pstate requests to go into the PLL stuff, along with idle states and a decision is made as to at what pstate the PLL will operate. You seem to be using the acpi-cpufreq CPU scaling driver, so I guess you have disabled the intel_pstate driver, which is fine, if that is your preference.



As for CPU frequency scaling tools / methods. I never use them. I only manage CPU frequency scaling with the basic primitive commands via the command line.



As to why your CPUs do not seem to go into the turbo range now, we would need more information to provide help. Starting with, for example:



doug@s15:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/scaling_driver
/sys/devices/system/cpu/cpufreq/policy0/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy1/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy2/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy3/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy4/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy5/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy6/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy7/scaling_driver:intel_pstate
doug@s15:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
/sys/devices/system/cpu/cpufreq/policy0/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy1/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy2/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy3/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy4/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy5/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy6/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy7/scaling_governor:powersave
doug@s15:~$ grep . /sys/devices/system/cpu/intel_pstate/* <<<< If driver is intel-pstate.
/sys/devices/system/cpu/intel_pstate/max_perf_pct:100
/sys/devices/system/cpu/intel_pstate/min_perf_pct:42
/sys/devices/system/cpu/intel_pstate/no_turbo:0
/sys/devices/system/cpu/intel_pstate/num_pstates:23
/sys/devices/system/cpu/intel_pstate/status:active
/sys/devices/system/cpu/intel_pstate/turbo_pct:18


Anticipated question: If there is only one PLL, and all CPU always operate at the same frequency, then why are different frequencies reported for them? Example:



doug@s15:~$ cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq
2186018
2315657
2308037
2254830
2111971
2127314
2169466
2152378


Answer: In any given measurement interval, the CPUs are also going into and out of various idle states, where, if the idle state is deep enough, the CPU clock is stopped. The reported frequency is the average active frequency for that processor over the last measurement interval.






share|improve this answer














The main thing for your processor is that there is only one Phase Locked Loop (PLL - which scales the CPU clock up and down) in the processor package. Therefore it has always been the case that the CPUs scale up and down in unision. The reason it used to seem different was that the acpi-cpufreq CPU scaling driver used to report what it thought the CPU frequencies should be rather than what they actually were. Now it reports what the frequencies actually are.



For almost all users / scenarios using cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq provides a good enough indicator as to what the individual CPU frequencies are. The reason the document has that disclaimer line it that it is possible that the information can be a little stale if a CPU has been idle with its clock stopped for awhile.



By default your processor should be using the intel-pstate CPU frequency driver and it has HWP (Hardware pstate control), meaning the processor itself can decide the requested pstate (CPU frequency). Note that all pstate requests to go into the PLL stuff, along with idle states and a decision is made as to at what pstate the PLL will operate. You seem to be using the acpi-cpufreq CPU scaling driver, so I guess you have disabled the intel_pstate driver, which is fine, if that is your preference.



As for CPU frequency scaling tools / methods. I never use them. I only manage CPU frequency scaling with the basic primitive commands via the command line.



As to why your CPUs do not seem to go into the turbo range now, we would need more information to provide help. Starting with, for example:



doug@s15:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/scaling_driver
/sys/devices/system/cpu/cpufreq/policy0/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy1/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy2/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy3/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy4/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy5/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy6/scaling_driver:intel_pstate
/sys/devices/system/cpu/cpufreq/policy7/scaling_driver:intel_pstate
doug@s15:~$ grep . /sys/devices/system/cpu/cpufreq/policy*/scaling_governor
/sys/devices/system/cpu/cpufreq/policy0/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy1/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy2/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy3/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy4/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy5/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy6/scaling_governor:powersave
/sys/devices/system/cpu/cpufreq/policy7/scaling_governor:powersave
doug@s15:~$ grep . /sys/devices/system/cpu/intel_pstate/* <<<< If driver is intel-pstate.
/sys/devices/system/cpu/intel_pstate/max_perf_pct:100
/sys/devices/system/cpu/intel_pstate/min_perf_pct:42
/sys/devices/system/cpu/intel_pstate/no_turbo:0
/sys/devices/system/cpu/intel_pstate/num_pstates:23
/sys/devices/system/cpu/intel_pstate/status:active
/sys/devices/system/cpu/intel_pstate/turbo_pct:18


Anticipated question: If there is only one PLL, and all CPU always operate at the same frequency, then why are different frequencies reported for them? Example:



doug@s15:~$ cat /sys/devices/system/cpu/cpufreq/policy*/scaling_cur_freq
2186018
2315657
2308037
2254830
2111971
2127314
2169466
2152378


Answer: In any given measurement interval, the CPUs are also going into and out of various idle states, where, if the idle state is deep enough, the CPU clock is stopped. The reported frequency is the average active frequency for that processor over the last measurement interval.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 26 at 15:36

























answered Nov 26 at 15:18









Doug Smythies

7,04631428




7,04631428












  • I've looked at the "scaling_cur_freq" values but couldn't reconcile them with other reported frequencies. Thank you very much. This pretty much confirms my suspicions, and I was looking for an authoritative answer. Someone needs to pin this answer.
    – rabinnh
    Nov 26 at 19:23












  • For anyone else that might stumble on this - I had 2 other issues due to upgrading older versions of Ubuntu. The "cpufreqd" init.d service was installed and conflicting with the systemd "ondemand" service. So I purged that. I tracked it down because the hardware had a min freq of 1.2Ghz and a max of 4.0Ghz but the policy was min 4.0Ghz and max 4.0Ghz. When I manually change the minimum (i.e. echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq) and restarted the systemctl ondemand service everything worked, so I knew something else was interfering.
    – rabinnh
    Nov 26 at 20:35












  • @rabinnh: If you liked my answer then please accept it. You only fixed the minimum frequency for CPU 0, you needed to fix it for all CPUs. As root: for file in /sys/devices/system/cpu/cpufreq/policy*/scaling_min_freq; do echo "1200000" > $file; done.
    – Doug Smythies
    Nov 26 at 22:26










  • OP may not have accepted answer but I liked it and up-voted it :)
    – WinEunuuchs2Unix
    Nov 27 at 2:27










  • Sorry, accepted it. Yes, I did it for all CPUs which is how I discovered the old service which was making the minimum frequency the same as the maximum.
    – rabinnh
    Nov 27 at 11:35


















  • I've looked at the "scaling_cur_freq" values but couldn't reconcile them with other reported frequencies. Thank you very much. This pretty much confirms my suspicions, and I was looking for an authoritative answer. Someone needs to pin this answer.
    – rabinnh
    Nov 26 at 19:23












  • For anyone else that might stumble on this - I had 2 other issues due to upgrading older versions of Ubuntu. The "cpufreqd" init.d service was installed and conflicting with the systemd "ondemand" service. So I purged that. I tracked it down because the hardware had a min freq of 1.2Ghz and a max of 4.0Ghz but the policy was min 4.0Ghz and max 4.0Ghz. When I manually change the minimum (i.e. echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq) and restarted the systemctl ondemand service everything worked, so I knew something else was interfering.
    – rabinnh
    Nov 26 at 20:35












  • @rabinnh: If you liked my answer then please accept it. You only fixed the minimum frequency for CPU 0, you needed to fix it for all CPUs. As root: for file in /sys/devices/system/cpu/cpufreq/policy*/scaling_min_freq; do echo "1200000" > $file; done.
    – Doug Smythies
    Nov 26 at 22:26










  • OP may not have accepted answer but I liked it and up-voted it :)
    – WinEunuuchs2Unix
    Nov 27 at 2:27










  • Sorry, accepted it. Yes, I did it for all CPUs which is how I discovered the old service which was making the minimum frequency the same as the maximum.
    – rabinnh
    Nov 27 at 11:35
















I've looked at the "scaling_cur_freq" values but couldn't reconcile them with other reported frequencies. Thank you very much. This pretty much confirms my suspicions, and I was looking for an authoritative answer. Someone needs to pin this answer.
– rabinnh
Nov 26 at 19:23






I've looked at the "scaling_cur_freq" values but couldn't reconcile them with other reported frequencies. Thank you very much. This pretty much confirms my suspicions, and I was looking for an authoritative answer. Someone needs to pin this answer.
– rabinnh
Nov 26 at 19:23














For anyone else that might stumble on this - I had 2 other issues due to upgrading older versions of Ubuntu. The "cpufreqd" init.d service was installed and conflicting with the systemd "ondemand" service. So I purged that. I tracked it down because the hardware had a min freq of 1.2Ghz and a max of 4.0Ghz but the policy was min 4.0Ghz and max 4.0Ghz. When I manually change the minimum (i.e. echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq) and restarted the systemctl ondemand service everything worked, so I knew something else was interfering.
– rabinnh
Nov 26 at 20:35






For anyone else that might stumble on this - I had 2 other issues due to upgrading older versions of Ubuntu. The "cpufreqd" init.d service was installed and conflicting with the systemd "ondemand" service. So I purged that. I tracked it down because the hardware had a min freq of 1.2Ghz and a max of 4.0Ghz but the policy was min 4.0Ghz and max 4.0Ghz. When I manually change the minimum (i.e. echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq) and restarted the systemctl ondemand service everything worked, so I knew something else was interfering.
– rabinnh
Nov 26 at 20:35














@rabinnh: If you liked my answer then please accept it. You only fixed the minimum frequency for CPU 0, you needed to fix it for all CPUs. As root: for file in /sys/devices/system/cpu/cpufreq/policy*/scaling_min_freq; do echo "1200000" > $file; done.
– Doug Smythies
Nov 26 at 22:26




@rabinnh: If you liked my answer then please accept it. You only fixed the minimum frequency for CPU 0, you needed to fix it for all CPUs. As root: for file in /sys/devices/system/cpu/cpufreq/policy*/scaling_min_freq; do echo "1200000" > $file; done.
– Doug Smythies
Nov 26 at 22:26












OP may not have accepted answer but I liked it and up-voted it :)
– WinEunuuchs2Unix
Nov 27 at 2:27




OP may not have accepted answer but I liked it and up-voted it :)
– WinEunuuchs2Unix
Nov 27 at 2:27












Sorry, accepted it. Yes, I did it for all CPUs which is how I discovered the old service which was making the minimum frequency the same as the maximum.
– rabinnh
Nov 27 at 11:35




Sorry, accepted it. Yes, I did it for all CPUs which is how I discovered the old service which was making the minimum frequency the same as the maximum.
– rabinnh
Nov 27 at 11:35


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1096177%2fafter-upgrade-to-18-04-cpufreq-scales-all-cpus-in-unison-rather-than-individual%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

Eduardo VII do Reino Unido