我的cpu最大频率是2.8GHZ,cpu频率模式是性能,但cpu周期仅为0.105GHZ从perf,为什么?
cpu循环事件是0x3c,是CPU_CLK_UNHALTED.THREAD_P还是CPU_CLK_THREAD_UNHALTED.REF_XCLK?
我能直接从perf中读取PMC寄存器吗?
现在,通过命令'mpstat‘,cpu-8的使用率达到90%。
CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
8 0.00 0.00 0.98 0.00 0.00 0.00 0.00 89.22 0.00 9.80
8 0.00 0.00 0.99 0.00 0.00 0.00 0.00 88.12 0.00 10.89cpu为Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz。
processor : 8
vendor_id : GenuineIntel
cpu family : 6
model : 62
model name : Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
stepping : 4
microcode : 0x428
cpu MHz : 2800.000
cache size : 25600 KB我想了解一下cpu-8的perf。
perf stat -C 8
Performance counter stats for 'CPU(s) 8':
8828.237941 task-clock (msec) # 1.000 CPUs utilized
11,550 context-switches # 0.001 M/sec
0 cpu-migrations # 0.000 K/sec
0 page-faults # 0.000 K/sec
926,167,840 cycles # 0.105 GHz
4,012,135,689 stalled-cycles-frontend # 433.20% frontend cycles idle
473,099,833 instructions # 0.51 insn per cycle
# 8.48 stalled cycles per insn
98,346,040 branches # 11.140 M/sec
1,254,592 branch-misses # 1.28% of all branches
8.828177754 seconds time elapsedcpu周期只有0.105GHZ,真的很奇怪。
我试着理解cpu周期的含义。
cat /sys/bus/event_source/devices/cpu/events/cpu-cycles
event=0x3c我查阅了文件“Intel 64和IA-32架构软件开发人员手册第3卷”,第19.6期,第40页。

我也检查cpu频率设置,cpu应该在最大频率运行。
cat scaling_governor
performance
cat scaling_governor
performance==============================================
我尝试这个命令:
taskset -c 8 stress --cpu 1
perf stat -C 8 sleep 10
Performance counter stats for 'CPU(s) 8':
10000.633899 task-clock (msec) # 1.000 CPUs utilized
1,823 context-switches # 0.182 K/sec
0 cpu-migrations # 0.000 K/sec
8 page-faults # 0.001 K/sec
29,792,267,638 cycles # 2.979 GHz
5,866,181,553 stalled-cycles-frontend # 19.69% frontend cycles idle
54,171,961,339 instructions # 1.82 insn per cycle
# 0.11 stalled cycles per insn
16,356,002,578 branches # 1635.497 M/sec
33,041,249 branch-misses # 0.20% of all branches
10.000592203 seconds time elapsed关于我的环境的一些详细信息
我运行一个应用程序,让我们把它称为'A',在虚拟机'V‘中,在主机’H‘中。
虚拟机由qume创建。
该应用程序用于接收来自网络的数据包并处理它们。
发布于 2021-05-05 02:37:00
由于CPU进入C1或C2空闲状态,CPU周期可能被冻结.
https://stackoverflow.com/questions/48334922
复制相似问题