Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[virtio-block] Request support for multi-stage resume of Windows to speed up hibernate/resume #1099

Open
zkq opened this issue May 21, 2024 · 5 comments
Assignees

Comments

@zkq
Copy link

zkq commented May 21, 2024

I have a Windows11 guest booted with QEMU and Virtio-blk device, it hibernates very slow (about several minutes) and the resume phase is single-stage(so resume time is longer). After I change the block device to nvme, it hibernates very fast(about several seconds) and the resume phase is two-stages(resume is very fast).

I don't know why virtio-block does not support the multi-stage resume, we'd better support it to have a much better user experience.

FYI:

  1. the multi-stage resume of Windows: https://learn.microsoft.com/en-us/windows-hardware/test/weg/delivering-a-great-startup-and-shutdown-experience#resume-phase
  2. To see whether multi-stage resume is enabled, we can go to Windows registry path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power, if the NoMultiStageResumeReason item is 0, then multi-stage resume is enabled.
@zkq zkq changed the title Request support for multi-stage resume of Windows to speed up hibernate/resume [virtio-block] Request support for multi-stage resume of Windows to speed up hibernate/resume May 21, 2024
@vrozenfe vrozenfe self-assigned this May 21, 2024
@vivianQizhu
Copy link

@vrozenfe
Copy link
Collaborator

@vivianQizhu
There are still some users who are running virtio-blk driver on top of different VMMs and even FPGA implemented virtio HBA(s). This feature can be nice to have, in addition to the other stuff like v3 DMA support etc.

Cheers,
Vadim.

@zkq
Copy link
Author

zkq commented May 22, 2024

@vrozenfe
Agree. This feature is very valuable, @vivianQizhu please consider to add it into development plan.

@vivianQizhu
Copy link

@vrozenfe @zkq Thanks, sure it is nice to have, I mean it won't be on high priority list. Cheers.

@zkq
Copy link
Author

zkq commented May 30, 2024

@vivianQizhu @vrozenfe

Hi, A good news that I have written some demo code and the vio-block driver supports MultiPhaseResume now. But the boot time is still very slow:

  1. Before MultiPhaseResume is supported, the first resume phase (executed by single vCPU) consumes about 10 seconds, then it enters windows desktop quickly.
  2. After MultiPhaseResume is supported, the first resume phase (executed by single vCPU) consumes less about 1 second, then the second resume phase (executed by all vCPUs) still consumes much time. This is abnormal.

And another issue of vio-block driver is about hibernate. When I start hibernate, all vCPUs run 100% for 1~2 minutes before windows writes hibernate file into disk. As I can see with NVME virtual device, the hibernate and resume process both are very fast. I guess the issue of vio-block for hibernate and resume are same as the problem looks similar.

Do you have any idea how to solve these issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants