Linux – What causes strange CPU usage output of htop in Bash on Windows

bashwindows 10windows-10-v1607windows-subsystem-for-linux

When I run htop in Bash on Windows I get the following output regarding CPU usage:
enter image description here
while the Windows Task Manager shows around 1% usage.

From here it's clear that htop's red regions are supposed to mean CPU usage by kernel threads, and green is for normal priority threads.

In the case of Bash on Windows it currently seems that the green is the actual CPU usage, but what does the red mean? Does it possibly represent a maximum limit of what the Windows-Linux subsystem can use, or is it merely a display bug, in which case why does it specifically show 50% usage for each CPU/hyperthread?

Best Answer

I have the same exact issue:

htop

As you can see I only have htop running and it barely uses 1.0% of CPU, on Windows I'm below 10% CPU usage while doing this. Even worse is that Thread 4 always has a green bar way bigger than the others. The percentage of all of them is always between 50-60%.

I believe it's an issue of implementation or just a bug, remember "bash on Windows" is still in beta. If someone knows a fix or at least a workaround that would be good.

Additional info regarding bash and potential issues during the beta: https://msdn.microsoft.com/en-us/commandline/wsl/about?f=255&MSPPError=-2147217396 (read the Important note)