【Linux】CPU频率控制|Conflicting CPU frequency values detected

本文介绍了在Linux系统中遇到的Conflicting CPU frequency问题及其解决方法。在测试IB网络时,由于CPU频率不一致导致测试失败。解决办法是停止cpuspeed服务,使用cpupower设置CPU为Performance模式。此外,还详细讲解了Linux的CPU频率管理策略,包括userspace、conservative、ondemand、powersave和performance模式,并提供了相关工具如cpupower的使用方法。
摘要由CSDN通过智能技术生成

目录

即看即用

背景

相关/原理:

使用cpupower设置CPU Performance模式

前言

更新历史

cpufreq的五种模式

cpupower设置performance

附录:

cpupower命令 – 调整CPU主频


@UESTC

即看即用

Linux 内部共有五种对频率的管理策略 userspace , conservative , ondemand , powersave(省电模式)  和  performance(性能模式)。

查看当前CPU模式:

查看cpu0

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

查看所有cpu

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

查看所有CPU频率:

cpupower -c all  frequency-info

设置CPU模式:

cpupower frequency-set -g performance #设置成性能模式 

cpupower frequency-set -g powersave     #设置成省电模式

背景

在测试IB网络中,遇到如下问题:

1.在一个节点上启动ib_write_bw

[root@storage2 ~]# ib_write_bw
------------------------------------------------------------------
                    RDMA_Write BW Test
 Number of qps   : 1
 Connection type : RC
 CQ Moderation   : 50
 Link type       : IB
 Mtu             : 2048
 Inline data is used up to 0 bytes message
 local address: LID 0x04 QPN 0x38004d PSN 0x26358e RKey 0x70003000 VAddr 0x007f1986890000
 remote address: LID 0x03 QPN 0x38004d PSN 0x4c35aa RKey 0x80003000 VAddr 0x007fa5ecb820002.在另一个节点上启动测试

[root@storage1 ~]# ib_write_bw 192.168.126.12
------------------------------------------------------------------
                    RDMA_Write BW Test
 Number of qps   : 1
 Connection type : RC
 TX depth        : 300
 CQ Moderation   : 50
 Mtu             : 2048B
 Link type       : IB
 Max inline data : 0B
 rdma_cm QPs : OFF
 Data ex. method : Ethernet
------------------------------------------------------------------
 local address: LID 0x03 QPN 0x6c0053 PSN 0x38d98e RKey 0x50003000 VAddr 0x007facff0ed000
 remote address: LID 0x04 QPN 0x2c004d PSN 0xd95310 RKey 0x58003000 VAddr 0x007f902e7d7000

------------------------------------------------------------------
 #bytes     #iterations    BW peak[MB/sec]    BW average[MB/sec]
Conflicting CPU frequency values detected: 1200.000000 != 2001.000000
 65536      5000           0.00               0.00   
------------------------------------------------------------------

3.运行后,没有结果,提示如下:

Conflicting CPU frequency values detected: 1200.000000 != 2001.000000

4.解决办法:

需要关闭两个节点上的cpuspeed服务。

[root@storage2 ~]# service cpuspeed stop
Disabling ondemand cpu frequency scaling:                  [  OK  ]
[root@storage1 ~]# service cpuspeed stop
Disabling ondemand cpu frequency scaling:                  [  OK  ]

关闭服务后,上述测试可以正常进行。

(我在本机执行上面的命令失败,因为cpuspeed是CPU管理工具,可能我的机器没有安装或者安装的不是这个CPU管理工具。经验证,是cpupower 参考:https://blog.csdn.net/lizhiqiang50/article/details/50992847

cpupower 命令使用方法:https://www.lmlphp.com/user/10313/article/item/419926/

查看文章:https://blog.csdn.net/hddghhfd/article/details/83956197)


5

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值