首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >cpufreq gnome扩展继续恢复到电源保存。

cpufreq gnome扩展继续恢复到电源保存。
EN

Ask Ubuntu用户
提问于 2018-04-01 22:14:23
回答 1查看 1.1K关注 0票数 1

我在使用cpufreq gnome扩展。我手动将其设置为性能,并在一分钟左右的时间内恢复到powersave。有人知道幕后发生了什么吗?

cat /etc/init.d/cpufrequtils的输出

代码语言:javascript
复制
#!/bin/sh
### BEGIN INIT INFO
# Provides:       cpufrequtils
# Required-Start: $remote_fs loadcpufreq
# Required-Stop:
# Default-Start:  2 3 4 5
# Default-Stop:
# Short-Description: set CPUFreq kernel parameters
# Description: utilities to deal with CPUFreq Linux 
#   kernel support
### END INIT INFO
# 

DESC="CPUFreq Utilities"

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin CPUFREQ_SET=/usr/bin/cpufreq-set CPUFREQ_INFO=/usr/bin/cpufreq-info CPUFREQ_OPTIONS=""

# use lsb-base . /lib/lsb/init-functions

# Which governor to use. Must be one of the governors listed in:
#   cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
#
# and which limits to set. Both MIN_SPEED and MAX_SPEED must be values
# listed in:
#   cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
# a value of 0 for any of the two variables will disabling the use of 
# that limit variable.
#
# WARNING: the correct kernel module must already be loaded or compiled in.
# 
# Set ENABLE to "true" to let the script run at boot time.
# 
# eg:   ENABLE="true"
#   GOVERNOR="ondemand"
#   MAX_SPEED=1000
#   MIN_SPEED=500

ENABLE="true" GOVERNOR="ondemand" MAX_SPEED="0" MIN_SPEED="0"

check_governor_avail() {    info="/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors"     if [ -f $info ] && grep -q "\<$GOVERNOR\>" $info ; then         return 0;   fi  return 1; }

[ -x $CPUFREQ_SET ] || exit 0

if [ -f /etc/default/cpufrequtils ] ; then  . /etc/default/cpufrequtils fi

# if not enabled then exit gracefully [ "$ENABLE" = "true" ] || exit 0

if [ -n "$MAX_SPEED" ] && [ $MAX_SPEED != "0" ] ; then  CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS --max $MAX_SPEED" fi

if [ -n "$MIN_SPEED" ] && [ $MIN_SPEED != "0" ] ; then  CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS --min $MIN_SPEED" fi

if [ -n "$GOVERNOR" ] ; then    CPUFREQ_OPTIONS="$CPUFREQ_OPTIONS
--governor $GOVERNOR" fi

CPUS=$(cat /proc/stat|sed -ne 's/^cpu\([[:digit:]]\+\).*/\1/p') RETVAL=0 case "$1" in   start|force-reload|restart|reload)      log_action_begin_msg "$DESC: Setting $GOVERNOR CPUFreq governor"        if check_governor_avail ; then          for cpu in $CPUS ; do
                log_action_cont_msg "CPU${cpu}"
                $CPUFREQ_SET --cpu $cpu $CPUFREQ_OPTIONS 2>&1 > /dev/null || \
                    RETVAL=$?           done            log_action_end_msg $RETVAL ""       else            log_action_cont_msg "disabled, governor not available"          log_action_end_msg $RETVAL      fi      ;;  stop)       ;;  *)      echo "Usage: $0 {start|stop|restart|reload|force-reload}"       exit 1 esac

exit 0

<#>The错误似乎是在17.10的指示器-cpu替换cpufreq扩展。通过避免这个扩展并使用命令行,下面的解决方案将起作用。

EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2018-04-01 23:20:08

在您的/etc/init.d/cpufrequtils文件更改中:

代码语言:javascript
复制
GOVERNOR="ondemand"

至:

代码语言:javascript
复制
GOVERNOR="performance"

剩下的行保持原样。保存并重新启动。

TL;DR回答如下:

就英特尔的速度调控器而言:

  • ondemand模式几年前就被废弃了。
  • 性能模式与电源保存模式相比几乎没有什么改善。

也就是说,您的处理器甚至可能不支持在performancepowersave之间进行选择。

若要查看可用的调速器,请使用以下命令:

代码语言:javascript
复制
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors 
performance powersave

如果您有多个调控器,则可以检查该命令当前使用的内容:

代码语言:javascript
复制
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
powersave

若要将处理器更改为性能模式,请使用:

代码语言:javascript
复制
$ echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
performance

然后,您将注意到CPU利用率下降了大约5%,但也注意到速度将从大约1,000 MHz提高到3,000 MHz,温度将上升10度,这取决于您的处理器:

我已经注意到,即使将Ubuntu第一次引导时设置为powersave模式(我通常使用的方式),它也在性能模式下运行90秒,然后最终进入powersave模式。

在手动将调控器设置为性能模式后,使用上面的适当命令。它已经在性能模式下停留了10分钟,使用上面的适当命令确认了这一点,上面的conky显示也证实了这一点。

我让州长在performance上开了30分钟,一切都很顺利。某些读者可能感兴趣的是,当将性能调控器切换回默认的powersave调控器时,conky显示是什么样子的:

CPU利用率提高了5%,但CPU频率下降了1500 MHz,温度下降了大约10度。总的来说,我认为powersave模式是大多数配置的最佳模式。

票数 1
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1021165

复制
相关文章

相似问题

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