KVM brokenness due to IO thread changes
Hi,
this is a heads-up, maybe someone has some time to look into this over the day: I seems like the IO thread changes caused a few regressions to the KVM mode.
When I keep this feature disabled, I see strange hick-ups of the event delivery mechanism, and the guest stops once in a while for a second or so. Attaching strace makes the whole process terminate early (looks like it triggers a race in the signal handling). And when I enable the IO thread, I immediately get a deadlock on qemu_global_mutex.
Moreover:
CC i386-softmmu/vl.o
/data/qemu/vl.c:4380: warning: ‘qemu_calculate_timeout’ defined but not used
Jan
Jan,
Quoted 11 lines · Jan Kiszka
Hi,
this is a heads-up, maybe someone has some time to look into this over the day: I seems like the IO thread changes caused a few regressions to the KVM mode.
When I keep this feature disabled, I see strange hick-ups of the event delivery mechanism, and the guest stops once in a while for a second or so. Attaching strace makes the whole process terminate early (looks like it triggers a race in the signal handling). And when I enable the IO thread, I immediately get a deadlock on
qemu_global_mutex.
Yes its borked. The iothread should signal the vcpu thread whenever it wants to grab the mutex lock, because unlike kvm-userspace it does not drop the global mutex when entering guest mode (VCPU_RUN ioctl).
Anthony will commit patches to fix that soon.
Quoted 6 lines
Moreover:
CCi386-softmmu/vl.o
/data/qemu/vl.c:4380: warning: ‘qemu_calculate_timeout’ defined but not usedJan
BTW, can you please review the changes made to the debugging logic in the main loop sometime? (there's a debug_requested global now).
Quoted 15 lines · Marcelo Tosatti
Jan,
Quoted 11 lines · Jan Kiszka
Hi,
this is a heads-up, maybe someone has some time to look into this over the day: I seems like the IO thread changes caused a few regressions to the KVM mode.
When I keep this feature disabled, I see strange hick-ups of the event delivery mechanism, and the guest stops once in a while for a second or so. Attaching strace makes the whole process terminate early (looks like it triggers a race in the signal handling). And when I enable the IO thread, I immediately get a deadlock on
qemu_global_mutex.
Quoted 5 lines
Yes its borked. The iothread should signal the vcpu thread whenever it wants to grab the mutex lock, because unlike kvm-userspace it does not drop the global mutex when entering guest mode (
VCPU_RUNioctl).Anthony will commit patches to fix that soon.
Looking forward. It's far more efficient to test my infrastructure changes against the KVM mode.
Quoted 10 lines
Quoted 6 lines
Moreover:
CCi386-softmmu/vl.o
/data/qemu/vl.c:4380: warning: ‘qemu_calculate_timeout’ defined but not usedJan
BTW, can you please review the changes made to the debugging logic in the main loop sometime? (there's a
debug_requestedglobal now).
Looks OK and works fine.
Jan
Quoted 22 lines · Jan Kiszka
Quoted 20 lines · Marcelo Tosatti
Jan,
Quoted 6 lines · Jan Kiszka
Hi,
this is a heads-up, maybe someone has some time to look into this over the day: I seems like the IO thread changes caused a few regressions to the KVM mode.
Quoted 6 lines
When I keep this feature disabled, I see strange hick-ups of the event delivery mechanism, and the guest stops once in a while for a second or so. Attaching strace makes the whole process terminate early (looks like it triggers a race in the signal handling). And when I enable the IO thread, I immediately get a deadlock on
qemu_global_mutex.Yes its borked. The iothread should signal the vcpu thread whenever it wants to grab the mutex lock, because unlike kvm-userspace it does not drop the global mutex when entering guest mode (
VCPU_RUNioctl).
Quoted 6 lines
Quoted 2 lines
Anthony will commit patches to fix that soon.
Looking forward. It's far more efficient to test my infrastructure changes against the KVM mode.
N.B. he's seeing issues with the IO thread disabled.
I've not seen this myself and my patch doesn't fix that problem.
Regards,
Anthony Liguori
Quoted 14 lines · Anthony Liguori
Quoted 14 lines
Quoted 14 lines
Quoted 10 lines
this is a heads-up, maybe someone has some time to look into this over the day: I seems like the IO thread changes caused a few regressions to the KVM mode.
When I keep this feature disabled, I see strange hick-ups of the event delivery mechanism, and the guest stops once in a while for a second or so. Attaching strace makes the whole process terminate early (looks like it triggers a race in the signal handling). And when I enable the IO thread, I immediately get a deadlock on
qemu_global_mutex.Yes its borked. The iothread should signal the vcpu thread whenever it wants to grab the mutex lock, because unlike kvm-userspace it does not drop the global mutex when entering guest mode (
VCPU_RUNioctl).
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Anthony will commit patches to fix that soon.
Looking forward. It's far more efficient to test my infrastructure changes against the KVM mode.
N.B. he's seeing issues with the IO thread disabled.
Jan,
Can you please provide more details on how to reproduce it? You're using -nographic?
All I see, with ping -c 0.1, is an eventual ~= 25ms in response time:
64 bytes from 192.168.122.140: icmp_seq=80 ttl=64 time=0.008 ms 64 bytes from 192.168.122.140: icmp_seq=81 ttl=64 time=0.008 ms 64 bytes from 192.168.122.140: icmp_seq=82 ttl=64 time=0.008 ms 64 bytes from 192.168.122.140: icmp_seq=83 ttl=64 time=0.023 ms 64 bytes from 192.168.122.140: icmp_seq=84 ttl=64 time=0.008 ms 64 bytes from 192.168.122.140: icmp_seq=85 ttl=64 time=0.008 ms 64 bytes from 192.168.122.140: icmp_seq=86 ttl=64 time=0.009 ms
Which is also seen before the patches.
Or even better, if you can bisect it...
Quoted 5 lines
I've not seen this myself and my patch doesn't fix that problem.
Regards,
Anthony Liguori