AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1417731
Accepted
Rob Decker
Rob Decker
Asked: 2022-07-08 22:24:28 +0800 CST2022-07-08 22:24:28 +0800 CST 2022-07-08 22:24:28 +0800 CST

Ubuntu 20.04 正在耗尽戴尔 XPS 上的电池 - CPU 核心空闲状态未缩放频率

  • 772

我在戴尔 XPS 9510 上运行带有最新更新的 Ubuntu 20.04,电池性能真的很差。在轻度使用(仅在简单网站上浏览网页)的情况下,我的电池续航时间最长约为 1 小时 30 小时,而在 Windows 下,笔记本电脑可以轻松达到 8 小时。差异是巨大的。

我检查了很多设置并安装了 TLP 以提高电池寿命而没有进行重大更改,但是我观察到一个奇怪的行为可能解释了这种高消耗。当核心处于空闲状态时,核心在负载下正确扩展时,频率会回到标称速度 (2,5Ghz) 而不是最低速度 (800Mhz)。

以下是一些输出:

    $ sudo tlp-stat -p
--- TLP 1.3.1 --------------------------------------------

+++ Processor
CPU model      = 11th Gen Intel(R) Core(TM) i9-11900H @ 2.50GHz

/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor  = powersave
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq  =  4800000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor  = powersave
/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq  =  4800000 [kHz]
/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu10/cpufreq/scaling_driver   = intel_pstate
/sys/devices/system/cpu/cpu10/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu10/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu10/cpufreq/scaling_min_freq =   800000 [kHz]
/sys/devices/system/cpu/cpu10/cpufreq/scaling_max_freq =  4800000 [kHz]
/sys/devices/system/cpu/cpu10/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu10/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu11/cpufreq/scaling_driver   = intel_pstate
/sys/devices/system/cpu/cpu11/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu11/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu11/cpufreq/scaling_min_freq =   800000 [kHz]
/sys/devices/system/cpu/cpu11/cpufreq/scaling_max_freq =  4800000 [kHz]
/sys/devices/system/cpu/cpu11/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu11/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu12/cpufreq/scaling_driver   = intel_pstate
/sys/devices/system/cpu/cpu12/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu12/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu12/cpufreq/scaling_min_freq =   800000 [kHz]
/sys/devices/system/cpu/cpu12/cpufreq/scaling_max_freq =  4900000 [kHz]
/sys/devices/system/cpu/cpu12/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu12/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu13/cpufreq/scaling_driver   = intel_pstate
/sys/devices/system/cpu/cpu13/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu13/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu13/cpufreq/scaling_min_freq =   800000 [kHz]
/sys/devices/system/cpu/cpu13/cpufreq/scaling_max_freq =  4900000 [kHz]
/sys/devices/system/cpu/cpu13/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu13/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu14/cpufreq/scaling_driver   = intel_pstate
/sys/devices/system/cpu/cpu14/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu14/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu14/cpufreq/scaling_min_freq =   800000 [kHz]
/sys/devices/system/cpu/cpu14/cpufreq/scaling_max_freq =  4800000 [kHz]
/sys/devices/system/cpu/cpu14/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu14/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu15/cpufreq/scaling_driver   = intel_pstate
/sys/devices/system/cpu/cpu15/cpufreq/scaling_governor = powersave
/sys/devices/system/cpu/cpu15/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu15/cpufreq/scaling_min_freq =   800000 [kHz]
/sys/devices/system/cpu/cpu15/cpufreq/scaling_max_freq =  4800000 [kHz]
/sys/devices/system/cpu/cpu15/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu15/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor  = powersave
/sys/devices/system/cpu/cpu2/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq  =  4800000 [kHz]
/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor  = powersave
/sys/devices/system/cpu/cpu3/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq  =  4800000 [kHz]
/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu4/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor  = powersave
/sys/devices/system/cpu/cpu4/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq  =  4900000 [kHz]
/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu5/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor  = powersave
/sys/devices/system/cpu/cpu5/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu5/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq  =  4900000 [kHz]
/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu6/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor  = powersave
/sys/devices/system/cpu/cpu6/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq  =  4800000 [kHz]
/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu7/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor  = powersave
/sys/devices/system/cpu/cpu7/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq  =  4800000 [kHz]
/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu8/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu8/cpufreq/scaling_governor  = powersave
/sys/devices/system/cpu/cpu8/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu8/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu8/cpufreq/scaling_max_freq  =  4800000 [kHz]
/sys/devices/system/cpu/cpu8/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu8/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu9/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu9/cpufreq/scaling_governor  = powersave
/sys/devices/system/cpu/cpu9/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu9/cpufreq/scaling_min_freq  =   800000 [kHz]
/sys/devices/system/cpu/cpu9/cpufreq/scaling_max_freq  =  4800000 [kHz]
/sys/devices/system/cpu/cpu9/cpufreq/energy_performance_preference = balance_power [HWP.EPP]
/sys/devices/system/cpu/cpu9/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/intel_pstate/min_perf_pct      =  16 [%]
/sys/devices/system/cpu/intel_pstate/max_perf_pct      = 100 [%]
/sys/devices/system/cpu/intel_pstate/no_turbo          =   0
/sys/devices/system/cpu/intel_pstate/turbo_pct         =  57 [%]
/sys/devices/system/cpu/intel_pstate/num_pstates       =  41

/sys/module/workqueue/parameters/power_efficient       = Y
/proc/sys/kernel/nmi_watchdog                          = 0





$paste <(ls /sys/devices/system/cpu/cpu0/cpufreq) <(cat /sys/devices/system/cpu/cpu0/cpufreq/*) | column -s $'\t' -t
affected_cpus                             0
base_frequency                            2500000
cpuinfo_max_freq                          4800000
cpuinfo_min_freq                          800000
cpuinfo_transition_latency                0
energy_performance_available_preferences  default performance balance_performance balance_power power 
energy_performance_preference             balance_power
related_cpus                              0
scaling_available_governors               performance powersave
scaling_cur_freq                          1103306
scaling_driver                            intel_pstate
scaling_governor                          powersave
scaling_max_freq                          4800000
scaling_min_freq                          800000
scaling_setspeed                          <unsupported>

$cat /proc/cpuinfo | grep "^[c]pu MHz"
cpu MHz     : 2500.000
cpu MHz     : 2500.000
cpu MHz     : 2500.000
cpu MHz     : 2500.000
cpu MHz     : 2500.000
cpu MHz     : 2500.000
cpu MHz     : 2500.000
cpu MHz     : 2500.000
cpu MHz     : 2500.000
cpu MHz     : 1070.651
cpu MHz     : 2500.000
cpu MHz     : 2500.000
cpu MHz     : 1102.344
cpu MHz     : 2500.000
cpu MHz     : 2500.000
cpu MHz     : 2500.000
dell
  • 1 1 个回答
  • 56 Views

1 个回答

  • Voted
  1. Best Answer
    Doug Smythies
    2022-07-09T07:08:38+08:002022-07-09T07:08:38+08:00

    当命令cat /proc/cpuinfo | grep "^[c]pu MHz"在 CPU 空闲时列出 2500.000 时,它只是一个默认的基本频率打印出来,因为实际的 CPU 频率信息是陈旧的,并且内核不想唤醒睡眠中的 CPU 只是为了确定它的工作频率。

    你可以看看/sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq:

    doug@s19:~$ uname -a
    Linux s19 5.13.0-52-generic #59~20.04.1-Ubuntu SMP Thu Jun 16 21:21:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
    doug@s19:~$ grep . /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
    /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq:800217
    /sys/devices/system/cpu/cpu10/cpufreq/scaling_cur_freq:800279
    /sys/devices/system/cpu/cpu11/cpufreq/scaling_cur_freq:800000
    /sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq:800004
    /sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq:800193
    /sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq:800290
    /sys/devices/system/cpu/cpu4/cpufreq/scaling_cur_freq:800143
    /sys/devices/system/cpu/cpu5/cpufreq/scaling_cur_freq:801221
    /sys/devices/system/cpu/cpu6/cpufreq/scaling_cur_freq:800419
    /sys/devices/system/cpu/cpu7/cpufreq/scaling_cur_freq:800160
    /sys/devices/system/cpu/cpu8/cpufreq/scaling_cur_freq:800362
    /sys/devices/system/cpu/cpu9/cpufreq/scaling_cur_freq:800214
    

    但是,从内核 5.19 开始,它的响应将更改为与 /proc/cpuinfo 相同:

    doug@s19:~$ uname -a
    Linux s19 5.19.0-rc5-stock #1072 SMP PREEMPT_DYNAMIC Mon Jul 4 07:58:15 PDT 2022 x86_64 x86_64 x86_64 GNU/Linux
    doug@s19:~$ grep . /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
    /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq:4100000
    /sys/devices/system/cpu/cpu10/cpufreq/scaling_cur_freq:799988
    /sys/devices/system/cpu/cpu11/cpufreq/scaling_cur_freq:4100000
    /sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq:4100000
    /sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq:4100000
    /sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq:800528
    /sys/devices/system/cpu/cpu4/cpufreq/scaling_cur_freq:4100000
    /sys/devices/system/cpu/cpu5/cpufreq/scaling_cur_freq:4100000
    /sys/devices/system/cpu/cpu6/cpufreq/scaling_cur_freq:4100000
    /sys/devices/system/cpu/cpu7/cpufreq/scaling_cur_freq:4100000
    /sys/devices/system/cpu/cpu8/cpufreq/scaling_cur_freq:4100000
    /sys/devices/system/cpu/cpu9/cpufreq/scaling_cur_freq:4100000
    

    话虽如此,CPU频率无论如何都不是调查能耗的方法。通常,但并非总是如此,更高的 CPU 频率可以让任务更快地完成,从而导致更多的时间处于深度空闲状态,从而减少能源消耗。大多数英特尔处理器(过去十年内)以及最近一些 AMD 处理器电源监控的推荐工具是 turbostat(我认为是 linux-tools-common 包)。例子:

    doug@s19:~$ sudo turbostat --Summary --quiet --show Busy%,Bzy_MHz,IRQ,PkgWatt,PkgTmp,RAMWatt,GFXWatt,CorWatt --interval 15
    Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt CorWatt GFXWatt RAMWatt
    0.01    1328    425     34      1.42    0.76    0.00    0.89
    0.01    800     269     34      1.39    0.73    0.00    0.89 <<< system idle
    0.01    800     291     34      1.38    0.72    0.00    0.89
    0.01    800     331     34      1.37    0.70    0.00    0.89
    81.14   4530    37381   68      110.03  109.37  0.00    0.89
    99.05   4513    45191   67      130.44  129.78  0.00    0.89 <<< Big load
    99.62   4482    45166   68      124.91  124.25  0.00    0.89 <<< Power limit throttling
    99.60   4478    45209   71      124.91  124.25  0.00    0.89
    99.58   4473    45171   72      124.92  124.25  0.00    0.89
    37.66   4470    17655   43      48.26   47.60   0.00    0.89
    0.01    800     315     42      1.52    0.86    0.00    0.89 <<< system idle
    0.01    800     316     42      1.50    0.84    0.00    0.89
    0.01    800     257     41      1.68    1.02    0.00    0.89
    
    • 0

相关问题

  • 如何重新安装声音驱动程序?

  • GMA 5700 MHD Dell Vostro 3300 外接 vga 显示器闪烁

  • 无法暂停 Dell Inspiron [关闭]

  • 有没有办法在显示器断开连接时自动检测?

  • 戴尔 Studio 1537 遥控器与红外接收端口 IT8512 CIR 的工作原理

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve