Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Kevin Locke <kevin@kevinlocke.name>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, Andi Kleen <ak@linux.intel.com>,
	Christian Ehrhardt <christian.ehrhardt@canonical.com>
Subject: Re: qemu polling KVM_IRQ_LINE_STATUS when stopped
Date: Fri, 26 Jun 2020 09:14:32 -0600	[thread overview]
Message-ID: <20200626151432.GA231100@kevinolos> (raw)
In-Reply-To: <1fbd0871-7a72-3e12-43af-d3c11c784d83@redhat.com>

On Thu, 2020-06-25 at 20:41 +0200, Paolo Bonzini wrote:
> On 25/06/20 16:26, Kevin Locke wrote:
>> 1. Do I understand correctly that the CPU usage is due to counting
>>    RTC periodic timer ticks for replay when the guest is resumed?
> 
> Yes.
> 
>> 2. If so, would it be possible to calculate the number of ticks
>>    required from the time delta at resume, rather than polling each
>>    tick while paused?
> 
> Note that high CPU usage while the guest is paused is a bug.  Only high
> CPU usage as soon as the guest resumes is the unavoidable part.

Although enabling the hv_stimer Hyper-V enlightenment avoids the
issue, I assume high CPU usage while the guest is paused when
hv_stimer is not enabled is still a bug.  It's not important for my
current use cases, but if there is interest in fixing the issue for
others, I was able to find a more minimal reproduction:

Using the Windows 10 May 2020 English 64-bit ISO from
https://www.microsoft.com/en-us/software-download/windows10ISO

If I run

qemu-system-x86_64 \
	-no-user-config \
	-machine pc-q35-5.0,accel=kvm \
	-m 1024 \
	-blockdev driver=file,node-name=win10iso,filename=Win10_2004_English_x64.iso \
	-device ide-cd,drive=win10iso \
	-no-hpet \
	-rtc driftfix=slew

then pause the VM after the "Windows Setup" window appears,
qemu-system-x86_64 uses ~40% CPU indefinitely.  Without
-rtc driftfix=slew, ~10%.  Without -no-hpet, ~1%.

For reference, both of these options are added by virt-manager by
default for Windows 10.

If there's anything else I can do to help, let me know.
Thanks again for all of the help tracking this down.

Best,
Kevin

      parent reply	other threads:[~2020-06-26 15:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17 21:34 qemu polling KVM_IRQ_LINE_STATUS when stopped Andi Kleen
2017-10-18  7:47 ` Paolo Bonzini
2017-10-18 17:49   ` Andi Kleen
2017-10-18 19:24     ` Paolo Bonzini
2017-10-20  0:34       ` Andi Kleen
2017-10-20  8:32         ` Paolo Bonzini
2017-10-20 14:09           ` Andi Kleen
2017-10-20 15:12             ` Paolo Bonzini
2017-10-20 20:50               ` Andi Kleen
2017-10-20 22:51                 ` Paolo Bonzini
2020-06-25 14:26                   ` Kevin Locke
2020-06-25 16:28                     ` Andi Kleen
2020-06-25 18:41                     ` Paolo Bonzini
2020-06-25 18:56                       ` Kevin Locke
2020-06-25 19:17                         ` Paolo Bonzini
2020-06-25 20:10                           ` Kevin Locke
2020-06-26 15:14                       ` Kevin Locke [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200626151432.GA231100@kevinolos \
    --to=kevin@kevinlocke.name \
    --cc=ak@linux.intel.com \
    --cc=christian.ehrhardt@canonical.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox