public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* qemu polling KVM_IRQ_LINE_STATUS when stopped
@ 2017-10-17 21:34 Andi Kleen
  2017-10-18  7:47 ` Paolo Bonzini
  0 siblings, 1 reply; 17+ messages in thread
From: Andi Kleen @ 2017-10-17 21:34 UTC (permalink / raw)
  To: kvm


One issue I see for some time is that even when I stop a Linux KVM guest using libvirt
it still sometimes uses a lot of CPU time.

According to strace it loops polling on KVM_IRQ_LINE_STATUS

I see it with various qemu versions, both FC25, FC26, OpenSUSE Leap 42.1/2

IIRC old enough KVM didn't have this problem, at least I didn't notice it.

My workaround is to kill -STOP the qemu process too, but is there a
better fix?

-Andi

strace of a stopped qemu using ~18% CPU time of a core.

write(7, "\1\0\0\0\0\0\0\0", 8)         = 8
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1118693, tv_nsec=583125997}) = 0
gettimeofday({tv_sec=1508275611, tv_usec=558425}, NULL) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1118693, tv_nsec=583171115}) = 0
ppoll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=7,
events=POLLIN}, {fd=8, events=POLLIN}, {fd=13, events=POLLIN}, {fd=15,
events=POLLIN}, {fd=24, events=POLLIN}], 7, {tv_sec=0, tv_nsec=0}, NULL,
8) = 1 ([{fd=7, revents=POLLIN}], left {tv_sec=0, tv_nsec=0})
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1118693, tv_nsec=583227127}) = 0
gettimeofday({tv_sec=1508275611, tv_usec=558526}, NULL) = 0
ioctl(12, KVM_IRQ_LINE_STATUS, 0x7ffc15ce8f30) = 0
gettimeofday({tv_sec=1508275611, tv_usec=558569}, NULL) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1118693, tv_nsec=583313870}) = 0
gettimeofday({tv_sec=1508275611, tv_usec=558612}, NULL) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1118693, tv_nsec=583357101}) = 0
ppoll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}, {fd=7,
events=POLLIN}, {fd=8, events=POLLIN}, {fd=13, events=POLLIN}, {fd=15,
events=POLLIN}, {fd=24, events=POLLIN}], 7, {tv_sec=0, tv_nsec=0}, NULL,
8) = 1 ([{fd=7, revents=POLLIN}], left {tv_sec=0, tv_nsec=0})
read(7, "\3\0\0\0\0\0\0\0", 512)        = 8
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1118693, tv_nsec=583433228}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1118693, tv_nsec=583455717}) = 0

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2020-06-26 15:14 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox