LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 441|回复: 1

CPU bios_limit 的值从何而来?

[复制链接]
发表于 2011-11-16 17:02:14 | 显示全部楼层 |阅读模式
最近发现CPU总是运行在最低频率,发现与 bios_limit有关:
重启后 bios_limit: 2501000, 运行一段时间后不规律地在 2501000 2500000 2000000 1600000 1200000 800000 变动,超过70%的时间处于最低的800000。

1. 内核设置为 performance
$grep -i freq /usr/src/linux/.config
# CPU Frequency scaling
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_STAT_DETAILS=y
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=m
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
# x86 CPU frequency scaling drivers
CONFIG_X86_PCC_CPUFREQ=m
CONFIG_X86_ACPI_CPUFREQ=m

2。CPU 运行情况
$ cpufreq-info
cpufrequtils 008: 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.50 GHz
  available frequency steps: 2.50 GHz, 2.50 GHz, 2.00 GHz, 1.60 GHz, 1.20 GHz, 800 MHz
  available cpufreq governors: userspace, ondemand, performance
  current policy: frequency should be within 800 MHz and 800 MHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 800 MHz (asserted by call to hardware).
  cpufreq stats: 2.50 GHz:12.22%, 2.50 GHz:0.62%, 2.00 GHz:0.69%, 1.60 GHz:7.41%, 1.20 GHz:7.61%, 800 MHz:71.44%  (91)
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.50 GHz
  available frequency steps: 2.50 GHz, 2.50 GHz, 2.00 GHz, 1.60 GHz, 1.20 GHz, 800 MHz
  available cpufreq governors: userspace, ondemand, performance
  current policy: frequency should be within 800 MHz and 800 MHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 800 MHz (asserted by call to hardware).
  cpufreq stats: 2.50 GHz:12.22%, 2.50 GHz:0.17%, 2.00 GHz:0.55%, 1.60 GHz:7.41%, 1.20 GHz:7.62%, 800 MHz:72.04%  (91)

3。检查sysfs

$ cd /sys/devices/system/cpu/cpu0/cpufreq
$ for i in `ls *_*`;do printf "%30s: %s\n" "$i" "`cat $i`"; done
                 affected_cpus: 0
                    bios_limit: 800000
              cpuinfo_cur_freq: 800000
              cpuinfo_max_freq: 2501000
              cpuinfo_min_freq: 800000
    cpuinfo_transition_latency: 10000
                  related_cpus: 0 1
scaling_available_frequencies: 2501000 2500000 2000000 1600000 1200000 800000
   scaling_available_governors: userspace ondemand performance
              scaling_cur_freq: 800000
                scaling_driver: acpi-cpufreq
              scaling_governor: performance
              scaling_max_freq: 800000
              scaling_min_freq: 800000
              scaling_setspeed: <unsupported>


据/usr/src/linux/Documentation/cpu-freq/user-guide.txt,bios_limit 应该是从BIOS设置,或者CPU限制,或者基于其他BIOS/硬件构造得到。

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.


4。检查BIOS
# midecode |grep -i max
        Max Speed: 2500 MHz
        Maximum Size: 32 kB
        Maximum Size: 6144 kB
        Maximum Capacity: 4 GB
        Maximum Error: 2%
        Maximum Value: 127.0 deg C

# midecode |less

Maximum Value: 127.0 deg C: 估计应该是CPU的工作温度上限
Max Speed: 2500 MHz              似乎应该是cpuinfo_max_freq。


那么 bios_limit 是怎么取得的?



===============================
发表于 2011-11-16 23:09:07 | 显示全部楼层
应该是bios里的一些节能选项决定的?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表