Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: 24.04 - CPU throttling after running on battery

  1. #1
    Join Date
    Jun 2008
    Location
    No beer for Jade Goody
    Beans
    37

    24.04 - CPU throttling after running on battery

    Just upgraded my laptop to 24.04 3 days ago.
    Yesterday I have noticed some odd performance problem after disconnecting mains power and running from battery. Laptop was incredibly laggy.

    The sequence of events was:
    - Run on mains power for a couple of days. Suspend/resume a bunch of times. All OK.
    - Suspend laptop. Disconnect power.
    - Run on battery for 30 minutes. All OK.
    - Suspend laptop
    - Resume laptop. CPU appears to be at 100% constantly, even processes that wouldn't normally use much CPU. Load average is in double digits.
    - Suspend laptop.
    - Connect mains power. Resume. Everything still terribly slow. Worked out that it seems to be CPU throttling. Did not record output but I think no CPU was over 200MHz.
    - Reboot. Spend over 5 minutes at 80% progress, got bored of this and alt+sysrq+b'd it.
    - Back to normal.



    Right now, things are normal:

    Code:
    # grep Hz /proc/cpuinfo
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 2242.986
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 798.119
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 798.185
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 798.164
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 798.061
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 798.128
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 798.055
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 798.071
    Not sure what to look for, or why this behaviour has changed.

  2. #2
    Join Date
    May 2024
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: 24.04 - CPU throttling after running on battery

    When you say the CPU is at 100%, can you run top/htop and see what process is taking up resources?

  3. #3
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    3,551
    Distro
    Ubuntu Development Release

    Re: 24.04 - CPU throttling after running on battery

    Quote Originally Posted by troffasky View Post
    - Run on battery for 30 minutes. All OK.
    - Suspend laptop
    - Resume laptop. CPU appears to be at 100% constantly, even processes that wouldn't normally use much CPU. Load average is in double digits.
    - Suspend laptop.
    - Connect mains power. Resume. Everything still terribly slow. Worked out that it seems to be CPU throttling. Did not record output but I think no CPU was over 200MHz.
    Is that sequence repeatable?

    Quote Originally Posted by troffasky View Post
    - Reboot. Spend over 5 minutes at 80% progress, got bored of this and alt+sysrq+b'd it.
    - Back to normal.
    I am a server person and do not know what "alt+sysrq+b'd" means. What does it mean?

    Yes, it appears to be CPU throttling. I only know of Clock Modulation to get such a low CPU frequency.

    Some MSRs (Machine Specific Register) might need to be examined. Before doing that try running turbostat (linux-tools-common package, I think) and post the start-up spew of information.

    Example (in your case, do it when the issue is present):
    Code:
    doug@s19:~/c$ sudo turbostat --Summary --show Busy%,Bzy_MHz,IRQ,PkgWatt,PkgTmp,RAMWatt,GFXWatt,CorWatt --interval 5
    turbostat version 2024.05.10 - Len Brown <lenb@kernel.org>  <<< You will have an older version, Shouldn't matter.
    ...
    cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x883a0000 (42 C)
    ...
    Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt CorWatt GFXWatt RAMWatt
    0.11    4788    1119    34      2.30    1.65    0.00    1.34
    ^C0.01  4801    25      34      2.05    1.41    0.00    1.33
    While I edited down to the main MSR of interest, you please post everything.

    turbostat needs and installs the msr module, which is also needed for the below command which might also help:

    Code:
    doug@s19:~/c$ sudo rdmsr -a 0x19a
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    and
    Code:
    doug@s19:~/c$ sudo rdmsr 0x64f
    200000
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  4. #4
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    3,551
    Distro
    Ubuntu Development Release

    Re: 24.04 - CPU throttling after running on battery

    Are you also the person that wrote this email to the linux power management group? The processor is the same, but the symptoms seem a little different, but similar enough.
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  5. #5
    Join Date
    Jun 2010
    Location
    London, England
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: 24.04 - CPU throttling after running on battery

    Your Intel i7 CPU has 4 cores. Are they all running at 100%? On Ubuntu 24.04 LTS System Settings>Power offers 3 settings - Performance; Balanced & Power Saver. Which setting is your machine running at?

    A CPU intensive task may force the CPU to run at 100% if the power is set to Power Saver.

    Regards
    It is a machine. It is more stupid than we are. It will not stop us from doing stupid things.
    Ubuntu user #33,200. Linux user #530,530


  6. #6
    Join Date
    Jun 2008
    Location
    No beer for Jade Goody
    Beans
    37

    Re: 24.04 - CPU throttling after running on battery

    Quote Originally Posted by Doug S View Post
    Is that sequence repeatable

    I will try this weekend when I have some free time, as it is quite painful

    Quote Originally Posted by Doug S View Post
    Example (in your case, do it when the issue is present):
    Code:
    doug@s19:~/c$ sudo turbostat --Summary --show Busy%,Bzy_MHz,IRQ,PkgWatt,PkgTmp,RAMWatt,GFXWatt,CorWatt --interval 5
    turbostat version 2024.05.10 - Len Brown <lenb@kernel.org>  <<< You will have an older version, Shouldn't matter.
    ...
    cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x883a0000 (42 C)
    ...
    Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt CorWatt GFXWatt RAMWatt
    0.11    4788    1119    34      2.30    1.65    0.00    1.34
    ^C0.01  4801    25      34      2.05    1.41    0.00    1.33
    While I edited down to the main MSR of interest, you please post everything.
    I will do this.

  7. #7
    Join Date
    Jun 2008
    Location
    No beer for Jade Goody
    Beans
    37

    Re: 24.04 - CPU throttling after running on battery

    Quote Originally Posted by Doug S View Post
    Are you also the person that wrote this email to the linux power management group? The processor is the same, but the symptoms seem a little different, but similar enough.
    Interesting! No, that is not me. I have suspend/resumed twice since the last boot and I am down to 1.4GHz, so it seems to be exactly the same behaviour.

    Code:
    # grep -H . /sys/devices/system/cpu/cpufreq/policy0/*
    /sys/devices/system/cpu/cpufreq/policy0/affected_cpus:0
    /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_max_freq:3500000
    /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_min_freq:800000
    /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_transition_latency:20000
    /sys/devices/system/cpu/cpufreq/policy0/related_cpus:0
    /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors:conservative ondemand userspace powersave performance schedutil 
    /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq:1396673
    /sys/devices/system/cpu/cpufreq/policy0/scaling_driver:intel_cpufreq
    /sys/devices/system/cpu/cpufreq/policy0/scaling_governor:schedutil
    /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq:1400000
    /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq:800000
    /sys/devices/system/cpu/cpufreq/policy0/scaling_setspeed:<unsupported>
    So this is probably not related to battery/AC running at all and actually just about suspend/resumes.

  8. #8
    Join Date
    Jun 2008
    Location
    No beer for Jade Goody
    Beans
    37

    Re: 24.04 - CPU throttling after running on battery

    I am not so sure now, I have suspend/resumed 2 more times but CPU frequency is not going down any more!

    Code:
    # grep -H . /sys/devices/system/cpu/cpufreq/policy0/*
    /sys/devices/system/cpu/cpufreq/policy0/affected_cpus:0
    /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_max_freq:3500000
    /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_min_freq:800000
    /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_transition_latency:20000
    /sys/devices/system/cpu/cpufreq/policy0/related_cpus:0
    /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors:conservative ondemand userspace powersave performance schedutil 
    /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq:2003163
    /sys/devices/system/cpu/cpufreq/policy0/scaling_driver:intel_cpufreq
    /sys/devices/system/cpu/cpufreq/policy0/scaling_governor:performance
    /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq:1400000
    /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq:1400000
    /sys/devices/system/cpu/cpufreq/policy0/scaling_setspeed:<unsupported>
    # grep Hz /proc/cpuinfo 
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 1940.180
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 1400.000
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 2013.062
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 1877.532
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 1400.000
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 1400.000
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 1860.740
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 1941.801
    I am not sure what to make of scaling_max_freq as it seems to be being exceeded? scaling_min_freq has gone up to 1400 because I was messing with cpupower-gui.
    Last edited by troffasky; June 1st, 2024 at 04:40 PM.

  9. #9
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    3,551
    Distro
    Ubuntu Development Release

    Re: 24.04 - CPU throttling after running on battery

    Do you have the ability to compile the kernel? If yes, can you confirm the bisection result of the person that posted on the linux power management email thread?

    For this (from the mainline source tree):
    Code:
    doug@s19:~/kernel/linux$ git log --oneline | grep -B 2 -A 2 950210887670
    a62cafe124b3 iommu/sprd: Convert to generic_single_device_group()
    4f43b6b6d1e0 iommu/sun50i: Convert to generic_single_device_group()
    950210887670 thermal: core: Drop trips_disabled bitmask
    e8f52d84cf0b iommu: Add generic_single_device_group()
    e946f8e3e62b iommu: Remove useless group refcounting
    I am asking for confirmation that a kernel compiled from code up to and including commit 950210887670 has the issue and a kernel compiled from e8f52d84cf0b, which it up to but not including commit 950210887670, does not have the issue.

    If you do not have the ability to compile those kernels, and if you are willing, I will compile them for you to test.

    Alternatively, just wait and see what happens on that email thread. I already posted on it that someone else was reporting the same issue on the same processor.
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  10. #10
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    3,551
    Distro
    Ubuntu Development Release

    Re: 24.04 - CPU throttling after running on battery

    Quote Originally Posted by troffasky View Post
    I am not so sure now, I have suspend/resumed 2 more times but CPU frequency is not going down any more!

    Code:
    # grep -H . /sys/devices/system/cpu/cpufreq/policy0/*
    /sys/devices/system/cpu/cpufreq/policy0/affected_cpus:0
    /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_max_freq:3500000
    /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_min_freq:800000
    /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_transition_latency:20000
    /sys/devices/system/cpu/cpufreq/policy0/related_cpus:0
    /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors:conservative ondemand userspace powersave performance schedutil 
    /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq:2003163
    /sys/devices/system/cpu/cpufreq/policy0/scaling_driver:intel_cpufreq
    /sys/devices/system/cpu/cpufreq/policy0/scaling_governor:performance
    /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq:1400000
    /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq:1400000
    /sys/devices/system/cpu/cpufreq/policy0/scaling_setspeed:<unsupported>
    # grep Hz /proc/cpuinfo 
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 1940.180
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 1400.000
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 2013.062
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 1877.532
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 1400.000
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 1400.000
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 1860.740
    model name      : Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
    cpu MHz         : 1941.801
    I am not sure what to make of scaling_max_freq as it seems to be being exceeded? scaling_min_freq has gone up to 1400 because
    We were typing at the same time. That scaling_max_freq never goes below 1.4 GHz is consistent with the other case. The scaling_cur_freq of 2003163 I do not understand at the moment.
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •