TOP does not show CPU usage for any process (0.0)

本文详细介绍了在Red Hat Enterprise Linux 7.6中,当遇到top命令无法正确显示进程CPU使用率的问题时的解决方案。故障可能源于TSC同步失败,重启机器并检查错误消息是否消失是一种解决办法。若问题持续,建议更新BIOS或升级内核到版本3.10.0-957.21.3.el7,该版本包含了更新的TSC时钟驱动。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

TOP does not show CPU usage for any process (0.0)

 SOLUTION 已验证 - 已更新 2019年七月25日16:56 - 

English 

环境

  • Red Hat Enterprise Linux 7.6

问题

  • TOP does not show CPU usage for any process (0.0)

决议

  • Restart the machine and check whether the TSC error message disappears.
  • A BIOS update is suggested.
  • If the error persists, update kernel to version kernel-3.10.0-957.21.3.el7 which has updated TSC clock drivers

根源

  • Due to a failure in TSC synchronization, top utility does not show CPU usage properly in the RHEL7.
  • The issue was identified in some Dell servers.

诊断步骤

After top had been running for around 1 minute while high intensive CPU operations were being executed, all processes showed no CPU usage.

You can verify that by running top in batch mode, then checking if some process is showing CPU usage (not 0.0).

Raw

#top -b -n10 > /tmp/top.txt
#awk '{if($1 ~ /^[0-9]/ && $9 != "0.0") print}' /tmp/top.txt

In a normal scenario, some output should appear (as the sample below).

Raw

#awk '{if($1 ~ /^[0-9]/ && $9 != "0.0") print}' /tmp/top.txt
19534 root       0 -20       0      0      0 I   0.3   0.0   0:07.00 kworker/u17:3-kcryptd/253:0
19880 root       0 -20       0      0      0 I   0.3   0.0   0:06.66 kworker/u17:7-kcryptd/253:0
20337 root       0 -20       0      0      0 I   0.3   0.0   0:04.18 kworker/u17:6-kcryptd/253:0
21208 root       20   0 2936108 282856 170584 S   0.3   1.8   0:09.72 Web Content
21299 root      20   0       0      0      0 I   0.3   0.0   0:00.05 kworker/7:2-mm_percpu_wq
21305 root       20   0 2874484 272912 136212 S   0.3   1.7   0:08.12 Web Content
21704 root       0 -20       0      0      0 I   0.3   0.0   0:00.45 kworker/u17:8-kcryptd/253:0

If no process appears, that may be a problem.

In addition to that, check whether the TSC clocksource error appeared in dmesg logs:

Raw

#dmesg | grep -ir "tsc\|clocksource"  
[    0.000000] tsc: Detected 2600.000 MHz processor
[    0.195594] TSC deadline timer enabled
[    0.201405] TSC synchronization [CPU#0 -> CPU#1]:
[    0.201407] Measured 249252531012 cycles TSC warp between CPUs, turning off TSC clock.
[    0.201409] tsc: Marking TSC unstable due to check_tsc_sync_source failed
[    0.456994] Switched to clocksource hpet

You should also see TSC clock is not available in available_clocksource file.

Raw

#cat sys/devices/system/clocksource/clocksource0/available_clocksource 
hpet acpi_pm 

As a consequence, the OS will switch to an alternative clocksource. Here, in this case, it's "hpet" and incorrect information may appear in top utility.

Raw

#cat sys/devices/system/clocksource/clocksource0/current_clocksource  
hpet
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值