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.

  • Already noticed such behavior with a WinXP KVM Guest. So I guess this is more a KVM host issue. I am also interested in this answer. – tonioc Jan 30 '15 at 13:44
  • Maybe this thing is related: bugs.launchpad.net/qemu/+bug/1174654 – Vi. Feb 1 '15 at 22:12

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.

  • Why do it need to read a few GB into RAW? It's not hibernation, it's suspend-to-ram. Does mapping the RAM to VM's page offset take a minute of 100% CPU time and proportional to the sleep time? The error is not to be ignored (it annoys, as I have to wait before accessing VM again). Actually BUG: soft lockup occurs not every time, but the freeze occurs always. – Vi. Jan 31 '15 at 8:39
  • Working with gigabytes of data takes time. You can't break the laws of physics. If you don't like it, don't suspend or hybernate your laptop. – dyasny Feb 1 '15 at 0:38
  • What gigabytes of data? It it clear why hibernation needs to work with gigabytes of data, but why the suspension? – Vi. Feb 1 '15 at 14:52
  • Because the VM pauses, and unpausing means reading and remapping the entire memdump into RAM again. – dyasny Feb 1 '15 at 18:20
  • Why should VM pause? I think it does not. I have just tried short suspend-to-raw of the host - no [visible] VM hang. The time for which it is busy after resuming is proportional to the time I keep computer suspended. – Vi. Feb 1 '15 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.