Hyper-V和WSL导致任务管理器CPU负载显示异常一例

故障描述:一台运行Windows Server 2022的工作站出于测试目的启用了Hyper-V虚拟机平台、安装了Windows Subsystem for Linux 2(WSL2)和基于WSL2后端的Docker Desktop。测试完毕后,依次卸载了Docker和WSL2,并使用服务器管理器移除了Hyper-V和WSL2功能。

重新启动计算机后,发现系统无负载时任务管理器对CPU使用率的统计异常维持在17%附近。但查看“系统空闲进程”的处理器占用正常显示99%。同时系统托盘中的CPU使用率图标正常显示为0%。

删除WSL2配置文件%USERPROFILE%/.wslconfig、禁用Hyper-V相关服务等无法解决问题。

故障处理:在命令提示符运行:

bcdedit /enum all

发现默认启动项{current}hypervisorlaunchtype属性为Auto。将其设为禁用:

bcdedit /set {current} hypervisorlaunchtype Off

重新启动计算机后,故障解决。

若需要重新启用HyperVisor,则执行:

bcdedit /set {current} hypervisorlaunchtype Auto

备注:该问题可能是由Hyper-V对根分区最大320个逻辑处理器的限制引发的(工作站具有384个逻辑处理器,(384-320)/384=64/384=16.67%)。请参考:

https://learn.microsoft.com/zh-cn/windows-server/virtualization/hyper-v/plan/plan-hyper-v-scalability-in-windows-server

https://learn.microsoft.com/zh-cn/troubleshoot/windows-server/virtualization/support-and-installation-instructions-for-amd-epyc-9004-series-server-processors

https://learn.microsoft.com/zh-cn/windows-server/virtualization/hyper-v/manage/manage-hyper-v-minroot-2016

it
除非特别注明,本页内容采用以下授权方式: Creative Commons Attribution-ShareAlike 3.0 License