# CPU scaling issues

## bigdweeb

I've been having problems with my CPU scaling for several months.  I have a Core2 Duo T9600 in my Dell Latitude E6400.  The problem I have is when I do something CPU intensive like compiling, the CPU will clock down to 800MHz and not allow me to manually scale it back up with cpufreq-set.  This has at least been happening since 2.6.32-r7.  I just upgraded to 2.6.34-r1 and it's still happening.  I was originally using the ondemand CPU governor built into the kernel.  I also tried compiling as modules a.  I have gone back to builtin with the current kernel I just built, switching to the performance governor and removing the ondemand one.  Does anyone have suggestions?  

I don't think the CPU is overheating.  I've been using the lm_sensors tools to check that.  I don't know how to figure out what's triggering these events.  

This is happening right now, and this is what cpufreq-info looks like.

```
[jart][12:07]/sys/devices/system/cpu/cpu0/cpufreq> cpufreq-info  

cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009

Report errors and bugs to cpufreq@vger.kernel.org, please.

analyzing CPU 0:

  driver: acpi-cpufreq

  CPUs which run at the same hardware frequency: 0 1

  CPUs which need to have their frequency coordinated by software: 0

  maximum transition latency: 10.0 us.

  hardware limits: 800 MHz - 2.80 GHz

  available frequency steps: 2.80 GHz, 2.80 GHz, 2.13 GHz, 1.60 GHz, 800 MHz

  available cpufreq governors: userspace, performance

  current policy: frequency should be within 800 MHz and 800 MHz.

                  The governor "userspace" may decide which speed to use

                  within this range.

  current CPU frequency is 800 MHz.

  cpufreq stats: 2.80 GHz:58.37%, 2.80 GHz:1.99%, 2.13 GHz:1.99%, 1.60 GHz:1.99%, 800 MHz:35.65%  (14)

analyzing CPU 1:

  driver: acpi-cpufreq

  CPUs which run at the same hardware frequency: 0 1

  CPUs which need to have their frequency coordinated by software: 1

  maximum transition latency: 10.0 us.

  hardware limits: 800 MHz - 2.80 GHz

  available frequency steps: 2.80 GHz, 2.80 GHz, 2.13 GHz, 1.60 GHz, 800 MHz

  available cpufreq governors: userspace, performance

  current policy: frequency should be within 800 MHz and 800 MHz.

                  The governor "userspace" may decide which speed to use

                  within this range.

  current CPU frequency is 800 MHz.

  cpufreq stats: 2.80 GHz:58.37%, 2.80 GHz:1.99%, 2.13 GHz:1.99%, 1.60 GHz:1.99%, 800 MHz:35.65%  (15)
```

----------

## snilsson

I notice that the ondemand govoner is not listed among the avaiable govoners. 

In my setup I have ondemand compiled into the kernel at it lists that both in cpufreq-info and like this:

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

userspace powersave ondemand performance 

```

Maybe you can find something in the Wiki http://en.gentoo-wiki.com/wiki/CPU_Frequency_Scaling

Edit: Oh, sorry missed the part where you mentioned you removed omdemand... then it looks more ok. But it says you use the userspace govoner and has selected 800-800 MHz.

I have ondemand configured as governor in the /etc/conf.d/cpufrequtils file and starts the cpufrequtils service at boot.

Can you try e.g. 

```
cpufreq-set --cpu 0 --governor performance

cpufreq-set --cpu 1 --governor performance

cpufrq-info

```

and see that the current governor is changed for both cores

----------

## alexandref75

I have a similar machine, Studio XPS 16  with a T9550 and had a similar problem that was temperature related. When a certain threshold was achieved the BIOS would throttle the machine to 800Mhz and would only return after a reboot. It got much better with the new BIOS, A14, and a laptop cooler. 

To test, check the temperature and speed with a intensive job in the background. 

AFAIK, that is a common problem for this machines and DELL released new BIOS to fix (or mitigate) the problem.

----------

## bigdweeb

In my original post I had changed to userspace in order to try forcing the CPU speed back up to 2.80GHz.

I have checked the BIOS on my laptop and I'm running the most current version.

I rebooted this morning and added cpufreq.debug=7 to the kernel.  I emerged something large and watched the log.  It quickly throttled down to 800MHz again.  I again tried switching to userspace and forcing the speed up.  Here's what I got in my logs.

```
Aug  3 13:07:43 jart kernel: [ 2574.408195] cpufreq-core: setting new policy for CPU 0: 800000 - 800000 kHz

Aug  3 13:07:43 jart kernel: [ 2574.408205] acpi-cpufreq: acpi_cpufreq_verify

Aug  3 13:07:43 jart kernel: [ 2574.408211] freq-table: request for verification of policy (800000 - 800000 kHz) for cpu 0

Aug  3 13:07:43 jart kernel: [ 2574.408221] freq-table: verification lead to (800000 - 800000 kHz) for cpu 0

Aug  3 13:07:43 jart kernel: [ 2574.408229] acpi-cpufreq: acpi_cpufreq_verify

Aug  3 13:07:43 jart kernel: [ 2574.408235] freq-table: request for verification of policy (800000 - 800000 kHz) for cpu 0

Aug  3 13:07:43 jart kernel: [ 2574.408245] freq-table: verification lead to (800000 - 800000 kHz) for cpu 0

Aug  3 13:07:43 jart kernel: [ 2574.408251] cpufreq-core: new min and max freqs are 800000 - 800000 kHz

Aug  3 13:07:43 jart kernel: [ 2574.408259] cpufreq-core: governor: change or update limits

Aug  3 13:07:43 jart kernel: [ 2574.408265] cpufreq-core: __cpufreq_governor for CPU 0, event 3

Aug  3 13:07:43 jart kernel: [ 2574.408272] userspace: limit event for cpu 0: 800000 - 800000 kHz, currently 800000 kHz, last set to 2801000 kHz

Aug  3 13:07:43 jart kernel: [ 2574.408283] cpufreq-core: target for CPU 0: 800000 kHz, relation 1

Aug  3 13:07:43 jart kernel: [ 2574.408289] acpi-cpufreq: acpi_cpufreq_target 800000 (0)

Aug  3 13:07:43 jart kernel: [ 2574.408298] freq-table: request for target 800000 kHz (relation: 1) for cpu 0

Aug  3 13:07:43 jart kernel: [ 2574.408305] freq-table: target is 4 (800000 kHz, 4)

Aug  3 13:07:43 jart kernel: [ 2574.408310] acpi-cpufreq: Called after resume, resetting to P4

Aug  3 13:07:43 jart kernel: [ 2574.408319] cpufreq-core: notification 0 of frequency transition to 800000 kHz

Aug  3 13:07:43 jart kernel: [ 2574.408325] userspace: saving cpu_cur_freq of cpu 0 to be 800000 kHz

Aug  3 13:07:43 jart kernel: [ 2574.408333] cpufreq-core: notification 1 of frequency transition to 800000 kHz

Aug  3 13:07:43 jart kernel: [ 2574.408342] userspace: saving cpu_cur_freq of cpu 0 to be 800000 kHz

Aug  3 13:07:44 jart sudo: obriapqz : TTY=pts/4 ; PWD=/home/obriapqz ; USER=root ; COMMAND=/usr/bin/cpufreq-set -g userspace -c 1

Aug  3 13:07:44 jart sudo: pam_unix(sudo:session): session opened for user root by obriapqz(uid=0)

Aug  3 13:07:44 jart sudo: pam_unix(sudo:session): session closed for user root

Aug  3 13:07:44 jart kernel: [ 2575.487251] cpufreq-core: setting new policy for CPU 1: 800000 - 800000 kHz

Aug  3 13:07:44 jart kernel: [ 2575.487281] acpi-cpufreq: acpi_cpufreq_verify

Aug  3 13:07:44 jart kernel: [ 2575.487281] acpi-cpufreq: acpi_cpufreq_verify

Aug  3 13:07:44 jart kernel: [ 2575.487288] freq-table: request for verification of policy (800000 - 800000 kHz) for cpu 1

Aug  3 13:07:44 jart kernel: [ 2575.487298] freq-table: verification lead to (800000 - 800000 kHz) for cpu 1

Aug  3 13:07:44 jart kernel: [ 2575.489837] acpi-cpufreq: acpi_cpufreq_verify

Aug  3 13:07:44 jart kernel: [ 2575.489848] freq-table: request for verification of policy (800000 - 800000 kHz) for cpu 1

Aug  3 13:07:44 jart kernel: [ 2575.489848] freq-table: request for verification of policy (800000 - 800000 kHz) for cpu 1

Aug  3 13:07:44 jart kernel: [ 2575.489855] freq-table: verification lead to (800000 - 800000 kHz) for cpu 1

Aug  3 13:07:44 jart kernel: [ 2575.489862] cpufreq-core: new min and max freqs are 800000 - 800000 kHz

Aug  3 13:07:44 jart kernel: [ 2575.489870] cpufreq-core: governor: change or update limits

Aug  3 13:07:44 jart kernel: [ 2575.489875] cpufreq-core: __cpufreq_governor for CPU 1, event 3

Aug  3 13:07:44 jart kernel: [ 2575.489883] userspace: limit event for cpu 1: 800000 - 800000 kHz, currently 800000 kHz, last set to 2801000 kHz

Aug  3 13:07:44 jart kernel: [ 2575.489893] cpufreq-core: target for CPU 1: 800000 kHz, relation 1

Aug  3 13:07:44 jart kernel: [ 2575.489899] acpi-cpufreq: acpi_cpufreq_target 800000 (1)

Aug  3 13:07:44 jart kernel: [ 2575.489909] freq-table: request for target 800000 kHz (relation: 1) for cpu 1

Aug  3 13:07:44 jart kernel: [ 2575.489915] freq-table: target is 4 (800000 kHz, 4)

Aug  3 13:07:44 jart kernel: [ 2575.489920] acpi-cpufreq: Called after resume, resetting to P4

Aug  3 13:07:44 jart kernel: [ 2575.489929] cpufreq-core: notification 0 of frequency transition to 800000 kHz

Aug  3 13:07:44 jart kernel: [ 2575.489936] userspace: saving cpu_cur_freq of cpu 1 to be 800000 kHz

Aug  3 13:07:44 jart kernel: [ 2575.489943] cpufreq-core: notification 1 of frequency transition to 800000 kHz

Aug  3 13:07:44 jart kernel: [ 2575.489953] userspace: saving cpu_cur_freq of cpu 1 to be 800000 kHz

Aug  3 13:07:54 jart sudo: obriapqz : TTY=pts/4 ; PWD=/home/obriapqz ; USER=root ; COMMAND=/usr/bin/cpufreq-set -f 2801000 -c -

Aug  3 13:07:57 jart sudo: obriapqz : TTY=pts/4 ; PWD=/home/obriapqz ; USER=root ; COMMAND=/usr/bin/cpufreq-set -f 2801000 -c -0

Aug  3 13:07:57 jart kernel: [ 2588.168694] cpufreq_debug_printk: 10 callbacks suppressed

Aug  3 13:07:57 jart kernel: [ 2588.168702] userspace: cpufreq_set for cpu 0, freq 2801000 kHz

Aug  3 13:07:57 jart kernel: [ 2588.168702] userspace: cpufreq_set for cpu 0, freq 2801000 kHz

Aug  3 13:07:57 jart kernel: [ 2588.168709] cpufreq-core: target for CPU 0: 800000 kHz, relation 0

Aug  3 13:07:57 jart kernel: [ 2588.168715] acpi-cpufreq: acpi_cpufreq_target 800000 (0)

Aug  3 13:07:57 jart kernel: [ 2588.168722] freq-table: request for target 800000 kHz (relation: 0) for cpu 0

Aug  3 13:07:57 jart kernel: [ 2588.168729] freq-table: target is 4 (800000 kHz, 4)

Aug  3 13:07:57 jart kernel: [ 2588.168734] acpi-cpufreq: Already at target state (P4)

Aug  3 13:08:03 jart sudo: obriapqz : TTY=pts/4 ; PWD=/home/obriapqz ; USER=root ; COMMAND=/usr/bin/cpufreq-set -f 2801000 -c 0

Aug  3 13:08:03 jart sudo: pam_unix(sudo:session): session opened for user root by obriapqz(uid=0)

Aug  3 13:08:03 jart sudo: pam_unix(sudo:session): session closed for user root

Aug  3 13:08:03 jart kernel: [ 2594.602858] userspace: cpufreq_set for cpu 0, freq 2801000 kHz

Aug  3 13:08:03 jart kernel: [ 2594.602867] cpufreq-core: target for CPU 0: 800000 kHz, relation 04.602867] cpufreq-core: target for CPU 0: 800000 kHz, relation 0

Aug  3 13:08:03 jart kernel: [ 2594.602873] acpi-cpufreq: acpi_cpufreq_target 800000 (0)

Aug  3 13:08:03 jart kernel: [ 2594.602880] freq-table: request for target 800000 kHz (relation: 0) for cpu 0

Aug  3 13:08:03 jart kernel: [ 2594.602887] freq-table: target is 4 (800000 kHz, 4)

Aug  3 13:08:03 jart kernel: [ 2594.602887] freq-table: target is 4 (800000 kHz, 4)

Aug  3 13:08:03 jart kernel: [ 2594.602892] acpi-cpufreq: Already at target state (P4)

Aug  3 13:08:04 jart sudo: obriapqz : TTY=pts/4 ; PWD=/home/obriapqz ; USER=root ; COMMAND=/usr/bin/cpufreq-set -f 2801000 -c 1

Aug  3 13:08:04 jart kernel: [ 2595.899883] userspace: cpufreq_set for cpu 1, freq 2801000 kHz

Aug  3 13:08:04 jart kernel: [ 2595.899891] cpufreq-core: target for CPU 1: 800000 kHz, relation 0

Aug  3 13:08:04 jart kernel: [ 2595.899898] acpi-cpufreq: acpi_cpufreq_target 800000 (1)

Aug  3 13:08:04 jart kernel: [ 2595.899904] freq-table: request for target 800000 kHz (relation: 0) for cpu 1

Aug  3 13:08:18 jart kernel: [ 2609.683293] cpufreq_debug_printk: 2 callbacks suppressed

Aug  3 13:08:18 jart kernel: [ 2609.683298] cpufreq-core: CPU 0: _PPC is 3 - frequency  limited

Aug  3 13:08:18 jart kernel: [ 2609.683303] cpufreq-core: updating policy for CPU 0

Aug  3 13:08:18 jart kernel: [ 2609.683306] acpi-cpufreq: get_cur_freq_on_cpu (0)

Aug  3 13:08:18 jart kernel: [ 2609.683310] acpi-cpufreq: get_cur_val = 100664855

Aug  3 13:08:18 jart kernel: [ 2609.683312] acpi-cpufreq: cur freq = 1600000

Aug  3 13:08:18 jart kernel: [ 2609.683316] cpufreq-core: Warning: CPU frequency out of sync: cpufreq and timing core thinks of 800000, is 1600000 kHz.

Aug  3 13:08:18 jart kernel: [ 2609.683319] cpufreq-core: notification 0 of frequency transition to 1600000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.683324] userspace: saving cpu_cur_freq of cpu 0 to be 1600000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.683327] cpufreq-core: notification 1 of frequency transition to 1600000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.683331] userspace: saving cpu_cur_freq of cpu 0 to be 1600000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.683334] cpufreq-core: setting new policy for CPU 0: 800000 - 2801000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.683337] acpi-cpufreq: acpi_cpufreq_verify

Aug  3 13:08:18 jart kernel: [ 2609.683340] freq-table: request for verification of policy (800000 - 2801000 kHz) for cpu 0

Aug  3 13:08:18 jart kernel: [ 2609.683343] freq-table: verification lead to (800000 - 2801000 kHz) for cpu 0

Aug  3 13:08:18 jart kernel: [ 2609.683347] acpi-cpufreq: acpi_cpufreq_verify

Aug  3 13:08:18 jart kernel: [ 2609.683350] freq-table: request for verification of policy (800000 - 1600000 kHz) for cpu 0

Aug  3 13:08:18 jart kernel: [ 2609.683354] freq-table: verification lead to (800000 - 1600000 kHz) for cpu 0

Aug  3 13:08:18 jart kernel: [ 2609.683357] cpufreq-core: new min and max freqs are 800000 - 1600000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.683360] cpufreq-core: governor: change or update limits

Aug  3 13:08:18 jart kernel: [ 2609.683362] cpufreq-core: __cpufreq_governor for CPU 0, event 3

Aug  3 13:08:18 jart kernel: [ 2609.683366] userspace: limit event for cpu 0: 800000 - 1600000 kHz, currently 1600000 kHz, last set to 2801000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.683370] cpufreq-core: target for CPU 0: 1600000 kHz, relation 1

Aug  3 13:08:18 jart kernel: [ 2609.683373] acpi-cpufreq: acpi_cpufreq_target 1600000 (0)

Aug  3 13:08:18 jart kernel: [ 2609.683376] freq-table: request for target 1600000 kHz (relation: 1) for cpu 0

Aug  3 13:08:18 jart kernel: [ 2609.683379] freq-table: target is 3 (1600000 kHz, 3)

Aug  3 13:08:18 jart kernel: [ 2609.683382] cpufreq-core: notification 0 of frequency transition to 1600000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.683385] userspace: saving cpu_cur_freq of cpu 0 to be 1600000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.683389] cpufreq-core: notification 1 of frequency transition to 1600000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.683392] userspace: saving cpu_cur_freq of cpu 0 to be 1600000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.684014] cpufreq-core: setting new policy for CPU 1: 800000 - 2801000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.684017] acpi-cpufreq: acpi_cpufreq_verify

Aug  3 13:08:18 jart kernel: [ 2609.684020] freq-table: request for verification of policy (800000 - 2801000 kHz) for cpu 1

Aug  3 13:08:18 jart kernel: [ 2609.684023] freq-table: verification lead to (800000 - 2801000 kHz) for cpu 1

Aug  3 13:08:18 jart kernel: [ 2609.684026] acpi-cpufreq: acpi_cpufreq_verify

Aug  3 13:08:18 jart kernel: [ 2609.684029] freq-table: request for verification of policy (800000 - 1600000 kHz) for cpu 1

Aug  3 13:08:18 jart kernel: [ 2609.684033] freq-table: verification lead to (800000 - 1600000 kHz) for cpu 1

Aug  3 13:08:18 jart kernel: [ 2609.684036] cpufreq-core: new min and max freqs are 800000 - 1600000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.684038] cpufreq-core: governor: change or update limits

Aug  3 13:08:18 jart kernel: [ 2609.684041] cpufreq-core: __cpufreq_governor for CPU 1, event 3

Aug  3 13:08:18 jart kernel: [ 2609.684045] userspace: limit event for cpu 1: 800000 - 1600000 kHz, currently 1600000 kHz, last set to 2801000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.684048] cpufreq-core: target for CPU 1: 1600000 kHz, relation 1

Aug  3 13:08:18 jart kernel: [ 2609.684051] acpi-cpufreq: acpi_cpufreq_target 1600000 (1)

Aug  3 13:08:18 jart kernel: [ 2609.684054] freq-table: request for target 1600000 kHz (relation: 1) for cpu 1

Aug  3 13:08:18 jart kernel: [ 2609.684057] freq-table: target is 3 (1600000 kHz, 3)

Aug  3 13:08:18 jart kernel: [ 2609.684060] cpufreq-core: notification 0 of frequency transition to 1600000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.684063] userspace: saving cpu_cur_freq of cpu 1 to be 1600000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.684068] cpufreq-core: notification 1 of frequency transition to 1600000 kHz

Aug  3 13:08:18 jart kernel: [ 2609.684071] userspace: saving cpu_cur_freq of cpu 1 to be 1600000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.649528] cpufreq_debug_printk: 10 callbacks suppressed

Aug  3 13:08:48 jart kernel: [ 2639.649531] cpufreq-core: CPU 0: _PPC is 2 - frequency  limited

Aug  3 13:08:48 jart kernel: [ 2639.649535] cpufreq-core: updating policy for CPU 0

Aug  3 13:08:48 jart kernel: [ 2639.649538] acpi-cpufreq: get_cur_freq_on_cpu (0)

Aug  3 13:08:48 jart kernel: [ 2639.649540] acpi-cpufreq: get_cur_val = 100665374

Aug  3 13:08:48 jart kernel: [ 2639.649543] acpi-cpufreq: cur freq = 2134000

Aug  3 13:08:48 jart kernel: [ 2639.649545] cpufreq-core: Warning: CPU frequency out of sync: cpufreq and timing core thinks of 1600000, is 2134000 kHz.

Aug  3 13:08:48 jart kernel: [ 2639.649548] cpufreq-core: notification 0 of frequency transition to 2134000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.649552] userspace: saving cpu_cur_freq of cpu 0 to be 2134000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.649554] cpufreq-core: notification 1 of frequency transition to 2134000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.649557] userspace: saving cpu_cur_freq of cpu 0 to be 2134000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.649559] cpufreq-core: setting new policy for CPU 0: 800000 - 2801000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.649561] acpi-cpufreq: acpi_cpufreq_verify

Aug  3 13:08:48 jart kernel: [ 2639.649564] freq-table: request for verification of policy (800000 - 2801000 kHz) for cpu 0

Aug  3 13:08:48 jart kernel: [ 2639.649566] freq-table: verification lead to (800000 - 2801000 kHz) for cpu 0

Aug  3 13:08:48 jart kernel: [ 2639.649569] acpi-cpufreq: acpi_cpufreq_verify

Aug  3 13:08:48 jart kernel: [ 2639.649571] freq-table: request for verification of policy (800000 - 2134000 kHz) for cpu 0

Aug  3 13:08:48 jart kernel: [ 2639.649574] freq-table: verification lead to (800000 - 2134000 kHz) for cpu 0

Aug  3 13:08:48 jart kernel: [ 2639.649577] cpufreq-core: new min and max freqs are 800000 - 2134000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.649579] cpufreq-core: governor: change or update limits

Aug  3 13:08:48 jart kernel: [ 2639.649581] cpufreq-core: __cpufreq_governor for CPU 0, event 3

Aug  3 13:08:48 jart kernel: [ 2639.649583] userspace: limit event for cpu 0: 800000 - 2134000 kHz, currently 2134000 kHz, last set to 2801000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.649586] cpufreq-core: target for CPU 0: 2134000 kHz, relation 1

Aug  3 13:08:48 jart kernel: [ 2639.649588] acpi-cpufreq: acpi_cpufreq_target 2134000 (0)

Aug  3 13:08:48 jart kernel: [ 2639.649591] freq-table: request for target 2134000 kHz (relation: 1) for cpu 0

Aug  3 13:08:48 jart kernel: [ 2639.649593] freq-table: target is 2 (2134000 kHz, 2)

Aug  3 13:08:48 jart kernel: [ 2639.649596] cpufreq-core: notification 0 of frequency transition to 2134000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.649598] userspace: saving cpu_cur_freq of cpu 0 to be 2134000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.649601] cpufreq-core: notification 1 of frequency transition to 2134000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.649603] userspace: saving cpu_cur_freq of cpu 0 to be 2134000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.650128] cpufreq-core: setting new policy for CPU 1: 800000 - 2801000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.650131] acpi-cpufreq: acpi_cpufreq_verify

Aug  3 13:08:48 jart kernel: [ 2639.650133] freq-table: request for verification of policy (800000 - 2801000 kHz) for cpu 1

Aug  3 13:08:48 jart kernel: [ 2639.650136] freq-table: verification lead to (800000 - 2801000 kHz) for cpu 1

Aug  3 13:08:48 jart kernel: [ 2639.650139] acpi-cpufreq: acpi_cpufreq_verify

Aug  3 13:08:48 jart kernel: [ 2639.650141] freq-table: request for verification of policy (800000 - 2134000 kHz) for cpu 1

Aug  3 13:08:48 jart kernel: [ 2639.650144] freq-table: verification lead to (800000 - 2134000 kHz) for cpu 1

Aug  3 13:08:48 jart kernel: [ 2639.650147] cpufreq-core: new min and max freqs are 800000 - 2134000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.650149] cpufreq-core: governor: change or update limits

Aug  3 13:08:48 jart kernel: [ 2639.650152] cpufreq-core: __cpufreq_governor for CPU 1, event 3

Aug  3 13:08:48 jart kernel: [ 2639.650155] userspace: limit event for cpu 1: 800000 - 2134000 kHz, currently 2134000 kHz, last set to 2801000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.650158] cpufreq-core: target for CPU 1: 2134000 kHz, relation 1

Aug  3 13:08:48 jart kernel: [ 2639.650160] acpi-cpufreq: acpi_cpufreq_target 2134000 (1)

Aug  3 13:08:48 jart kernel: [ 2639.650163] freq-table: request for target 2134000 kHz (relation: 1) for cpu 1

Aug  3 13:08:48 jart kernel: [ 2639.650166] freq-table: target is 2 (2134000 kHz, 2)

Aug  3 13:08:48 jart kernel: [ 2639.650168] cpufreq-core: notification 0 of frequency transition to 2134000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.650171] userspace: saving cpu_cur_freq of cpu 1 to be 2134000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.650174] cpufreq-core: notification 1 of frequency transition to 2134000 kHz

Aug  3 13:08:48 jart kernel: [ 2639.650177] userspace: saving cpu_cur_freq of cpu 1 to be 2134000 kHz
```

Is there a way to counteract whatever is triggering this event to set the freq-table back to normal?

----------

## bigdweeb

Also, is there a way to figure out what threshold is being met that triggers this event?  The fans are quite often running on this machine.  The laptop does sit on a docking station almost all the time which props it off the table and allows air to flow underneath, so I would think it would do better with heat dissipation.

----------

## snilsson

This seems more tricky then I first thought.

I don't know much about the details but if it is the BIOS that makes the restriction it should be visible using 

```
cat /sys/devices/system/cpu/cpu0/cpufreq/bios_limit
```

From the kernel doc:

```
bios_limit :   If the BIOS tells the OS to limit a CPU to lower frequencies, the user can read out the

               maximum available frequency from this file This typically can happen through (often not

               intended) BIOS settings, restrictions triggered through a service processor or other

               BIOS/HW based implementations.

               This does not cover thermal ACPI limitations which can be detected through the generic

               thermal driver.
```

----------

## bigdweeb

If I look at the bios_limit, it is indeed set down to 800MHz.

```
[jart][15:56]~> cat /sys/devices/system/cpu/cpu0/cpufreq/bios_limit 

800000
```

Is there a way to reprobe the BIOS or repopulate that value when it gets throttled down?  It seems from some research that this model has a tendency to overheat.  Even once the temp readings through the 'sensors' command come back down, that value isn't changing so the CPU won't scale back up.

----------

## alexandref75

I am using a script that sets the thermal cooling at /sys/class/thermal/cooling_device at certain thresholds. Setting a higher number at this cooling_devices (cur_state) reduces the CPU speed a little. This is better than the hard threshold that the BIOS set (800MhZ). 

When the BIOS threshold is tripped and the machine is stuck at 800MHz, I had some luck of returning the normal speed by removing the ac adapter for 10-15 seconds. it is easier to do by checking the output of the script below: 

#!/bin/bash

while true

do

        sleep 1

        echo `date` `cat /sys/class/thermal/thermal_zone0/temp` `cat /sys/class/thermal/thermal_zone1/temp` `cat /sys/class/thermal/thermal_zone2/temp` `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq`

done

This script can also help to log the temperatures and speed to determine when the threshold of the BIOS is tripped.

 *bigdweeb wrote:*   

> If I look at the bios_limit, it is indeed set down to 800MHz.
> 
> ```
> [jart][15:56]~> cat /sys/devices/system/cpu/cpu0/cpufreq/bios_limit 
> 
> ...

 

This script keeps my machine working much better (does not hit the BIOS threshold), but slows the machine for CPU/GPU intensive applications. 

```
#!/bin/bash

# use the cooling devices.

#at the threshold_up increase the cooling

#at the threshold_down decrease the temperature

#at threshold_zero remove the cooling

# find the cooling devices:

max_state=

COOLING_DEVICE=

for i in /sys/class/thermal/cooling_device*

do

        if [ -e $i/type ]

        then

                typeCooling=`cat $i/type`

                case $typeCooling in

                        Processor) COOLING_DEVICE=$COOLING_DEVICE" "$i/cur_state;

                                   if [[ `cat $i/max_state` -gt $max_state || "x$max_state" == "x" ]] 

                                   then

                                        max_state=`cat $i/max_state`

                                   fi

                                   ;;

                esac

        fi

done

function setCoolingLevel()

{

        #echo $COOLING_DEVICE

        for a in $COOLING_DEVICE 

        do

        #       echo $last_action $a

                echo $last_action > $a                                                                                                                                                                             

        done                                                                                                                                                                                                       

        logger -t "Temperature_limit" -p syslog.info "Setting cooling level to $last_action"                                                                                                                       

        echo "Setting cooling level to $last_action"                                                                                                                                                               

}                                                                                                                                                                                                                  

                                                                                                                                                                                                                   

Threshold_up_max=92000                                                                                                                                                                                             

Threshold_up=88000                                                                                                                                                                                                 

Threshold_up_delta_max=7000                                                                                                                                                                                        

Threshold_down=72000                                                                                                                                                                                               

Threshold_zero=68000                                                                                                                                                                                               

last_action=0

time_temp_over_limit=60

temp_over_limit=75000

logger -t "Temperature_limit" -p syslog.info "Inicializing temperature control"

echo "Inicializing temperature control and max_state is $max_state"

setCoolingLevel

modified=0

seconds_over_limit=0

temperatureNow=`cat /sys/class/thermal/thermal_zone0/temp`

while true

do

        last_temp=$temperatureNow

        if [ $modified -gt 0 ]

        then

                ((modified=$modified-1))

        fi

        sleep 1

        temperatureNow=`cat /sys/class/thermal/thermal_zone0/temp`

        ((delta_temp=$temperatureNow-$last_temp))

        #echo "Temp="$temperatureNow" max-speed="`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq`

        if [[ $temperatureNow -ge $temp_over_limit ]] 

        then

                ((seconds_over_limit=$seconds_over_limit+1))

                if [[ $seconds_over_limit -ge $time_temp_over_limit ]]

                then 

                        ((last_action=$last_action+1))

                        setCoolingLevel

                        echo "Increasing the cooling level to "$last_action

                        ((seconds_over_limit=$seconds_over_limit-3))

                        continue;

                fi

        else

                seconds_over_limit=0

        fi

        if [[ $temperatureNow -ge $Threshold_up_max ]] 

        then

                last_action=$max_state

                setCoolingLevel

                echo  "Putting the cooling in max "$last_action

                continue;

        fi

        if [[ $delta_temp -ge $Threshold_up_delta_max && $temperatureNow -ge $Threshold_up ]] 

        then

                last_action=$max_state

                setCoolingLevel

                echo  "Putting the cooling in max rising too fast "$last_action

                continue;

        fi

        if [[ $temperatureNow -lt $Threshold_zero ]] 

        then

                if [ $last_action -gt 0 ]

                then

                        last_action=0

                        setCoolingLevel

                        echo  "Putting the cooling in zero"

                fi

                continue;

        fi

        if [[ $temperatureNow -gt $Threshold_up && $delta_temp -gt 0 ]] 

        then

                if [[ $last_action -lt $max_state  ]]

                then

                        ((last_action=$last_action+1))

                        setCoolingLevel

                        echo "Increasing the cooling level to "$last_action

                else

                        logger -t "Temperature_limit" -p syslog.warn "Step 1 max achieved "$last_action

                        echo "Step 1 max achieved "$last_action

                fi

                continue

        fi

        if [[ $temperatureNow -lt $Threshold_down ]] 

        then

                if [[ $last_action -gt 0 && $modifed -eq 0 ]]

                then

                        ((last_action=$last_action-1))

                        setCoolingLevel

                        echo "Decreasing the cooling level to "$last_action

                        modified=2

                fi

        fi

done
```

----------

