首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ubuntu 20.04正在耗尽戴尔XPS上的电池- CPU核心空闲状态,不缩放频率。

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

Ask Ubuntu用户
提问于 2022-07-08 06:24:28
回答 1查看 524关注 0票数 0

我运行的Ubuntu20.04最新更新的戴尔XPS 9510和电池性能真的很差。使用轻量(仅在简单网站上浏览网页),我的电池寿命最高可达1小时30,而在Windows下,笔记本电脑可以轻松达到8小时。差别很大。

我检查了许多设置,并安装了TLP以提高电池寿命,但没有发生重大变化,但我观察到一种奇怪的行为,可能会解释这种高耗电量。当磁芯处于空闲状态时,当磁芯在负载下适当地缩放时,频率回到标称速度(2,5 the ),而不是最小速度(800 the )。

以下是一些输出:

代码语言:javascript
复制
    $ 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                          

$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
EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2022-07-08 15:08:38

当一个CPU空闲时,命令cat /proc/cpuinfo | grep "^[c]pu MHz"列出2500.000,这仅仅是一个默认的基频打印,因为实际的CPU频率信息已经过时,并且内核不想仅仅为了确定其工作频率而唤醒休眠的CPU。

您可以转而查看/sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq

代码语言:javascript
复制
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相同:

代码语言:javascript
复制
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通用软件包)。示例:

代码语言:javascript
复制
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
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1417731

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档