Linux – Why Linux inside KVM gets busy after I put the host to suspend-to-ram

kvmlinuxsuspend

I run another Linux instance inside KVM on my laptop.

When I suspend-to-ram the laptop and wake it up again, the guest Linux starts consuming 100% CPU for some time (maybe proportional to the sleep time) and becomes completely irresponsive. After it finally unstucks itself, I see BUG: soft lockup - CPU#0 stuck for 22s.

Why does it happen? How do I prevent this?

Note: The question is not about pausing (suspeding) the VM or guest system. It is about the disruption caused by host's suspend-to-ram.

Best Answer

The error can be ignored. This is due to the fact that the virtual CPU thinks it has missed some time, i.e. has been locked up, while in fact it was suspended and couldn't get scheduled while unsuspending.

As for the load, it's normal, reading a few GB of data into RAM, mapping the RAM to the VM's page offset takes loads of CPU and disk operations.

Related Question