免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5485 | 回复: 6
打印 上一主题 下一主题

关于CPU频率 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-07-04 20:43 |只看该作者 |倒序浏览
1 请问在/proc/cpuinfo下看到的CPU频率是当前频率吗,如果不是,如何查看(不使用第三方软件)?
2 编译前配置内核时能不能限制CPU频率?如果做到限制CPU频率(不使用第三方软件)?

论坛徽章:
1
天蝎座
日期:2013-12-06 18:23:58
2 [报告]
发表于 2011-07-04 23:40 |只看该作者
是当前的频率!

不知道能不能限制,这个是内核自己调度的吧?不过好像可以指定多核多线程编译。 make -jn

论坛徽章:
0
3 [报告]
发表于 2011-07-05 08:42 |只看该作者
应该可以限制cpu频率,看过笔记本电脑在空闲期,频率自动下降。肯定有指令能调节cpu频率

论坛徽章:
0
4 [报告]
发表于 2011-07-05 14:51 |只看该作者
1 请问在/proc/cpuinfo下看到的CPU频率是当前频率吗,如果不是,如何查看(不使用第三方软件)?
2 编译前 ...
spongebooob 发表于 2011-07-04 20:43



    processor.mac_cstate=1 能限制运行在最高频率,考限制deep c状态。你可以看一下kernel的文档

论坛徽章:
5
摩羯座
日期:2014-07-22 09:03:552015元宵节徽章
日期:2015-03-06 15:50:392015亚冠之大阪钢巴
日期:2015-06-12 16:01:352015年中国系统架构师大会
日期:2015-06-29 16:11:2815-16赛季CBA联赛之四川
日期:2018-12-17 14:10:21
5 [报告]
发表于 2011-07-05 15:10 |只看该作者

  1. [root@btg P5906]# cat /sys/devices/system/cpu/cpu0/
  2. cache/            cpufreq/          cpuidle/          crash_notes       microcode/        thermal_throttle/ topology/         
  3. [root@btg P5906]# cat /sys/devices/system/cpu/cpu0/cpufreq/
  4. affected_cpus                  cpuinfo_min_freq               scaling_available_frequencies  scaling_governor               
  5. bios_limit                     cpuinfo_transition_latency     scaling_available_governors    scaling_max_freq               
  6. cpuinfo_cur_freq               ondemand/                      scaling_cur_freq               scaling_min_freq               
  7. cpuinfo_max_freq               related_cpus                   scaling_driver                 scaling_setspeed               
  8. [root@btg P5906]# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
  9. 2300000
  10. [root@btg P5906]# cat /proc/cpuinfo
  11. processor        : 0
  12. vendor_id        : GenuineIntel
  13. cpu family        : 6
  14. model                : 23
  15. model name        : Pentium(R) Dual-Core CPU       T4500  @ 2.30GHz
  16. stepping        : 10
  17. cpu MHz                : 1200.000
  18. cache size        : 1024 KB
  19. physical id        : 0
  20. siblings        : 2
  21. core id                : 0
  22. cpu cores        : 2
  23. apicid                : 0
  24. initial apicid        : 0
  25. fdiv_bug        : no
  26. hlt_bug                : no
  27. f00f_bug        : no
  28. coma_bug        : no
  29. fpu                : yes
  30. fpu_exception        : yes
  31. cpuid level        : 13
  32. wp                : yes
  33. flags                : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm
  34. bogomips        : 4587.80
  35. clflush size        : 64
  36. cache_alignment        : 64
  37. address sizes        : 36 bits physical, 48 bits virtual
  38. power management:

  39. processor        : 1
  40. vendor_id        : GenuineIntel
  41. cpu family        : 6
  42. model                : 23
  43. model name        : Pentium(R) Dual-Core CPU       T4500  @ 2.30GHz
  44. stepping        : 10
  45. cpu MHz                : 1200.000
  46. cache size        : 1024 KB
  47. physical id        : 0
  48. siblings        : 2
  49. core id                : 1
  50. cpu cores        : 2
  51. apicid                : 1
  52. initial apicid        : 1
  53. fdiv_bug        : no
  54. hlt_bug                : no
  55. f00f_bug        : no
  56. coma_bug        : no
  57. fpu                : yes
  58. fpu_exception        : yes
  59. cpuid level        : 13
  60. wp                : yes
  61. flags                : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm
  62. bogomips        : 4588.25
  63. clflush size        : 64
  64. cache_alignment        : 64
  65. address sizes        : 36 bits physical, 48 bits virtual
  66. power management:

  67. [root@btg P5906]#

复制代码

论坛徽章:
0
6 [报告]
发表于 2011-07-13 10:08 |只看该作者
参考 documentation/cpu-freq/governors.txt

freq_step: this describes what percentage steps the cpu freq should be increased and decreased smoothly by.  By default the cpu frequency will increase in 5% chunks of your maximum cpu frequency.  You can change this value to anywhere between 0 and 100 where '0' will effectively lock your CPU at a speed regardless of its load whilst '100' will, in theory, make it behave identically to the "ondemand" governor.

动态调整CPU频率每一步是freq_step,默认5%,如果设置为0,CPU就不会再调整频率了。我在我的板子上试了一下,是这么回事

我板子的freq_step路径是/sys/devices/system/cpu/cpu0/cpufreq/conservative/freq_step

论坛徽章:
0
7 [报告]
发表于 2011-07-16 15:27 |只看该作者
CPU频率在编译的时候会确认几档频率值,有最大和最小,根据内核cpufre配置要求不同,运行频率的调用方式也不同,比如perfermance时,cpu一直会选择最高性能运行,ondemand时,会根据负载情况动态调整
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP