pve-qemu/debian
Thomas Lamprecht 4ff04bdfa5 work around stuck guest IO with iothread and VirtIO block/SCSI
This essentially repeats commit 6b7c181 ("add patch to work around
stuck guest IO with iothread and VirtIO block/SCSI") with an added
fix for the SCSI event virtqueue, which requires special handling.
This is to avoid the issue [3] that made the revert 2a49e66 ("Revert
"add patch to work around stuck guest IO with iothread and VirtIO
block/SCSI"") necessary the first time around.

When using iothread, after commits
1665d9326f ("virtio-blk: implement BlockDevOps->drained_begin()")
766aa2de0f ("virtio-scsi: implement BlockDevOps->drained_begin()")
it can happen that polling gets stuck when draining. This would cause
IO in the guest to get completely stuck.

A workaround for users is stopping and resuming the vCPUs because that
would also stop and resume the dataplanes which would kick the host
notifiers.

This can happen with block jobs like backup and drive mirror as well
as with hotplug [2].

Reports in the community forum that might be about this issue[0][1]
and there is also one in the enterprise support channel.

As a workaround in the code, just re-enable notifications and kick the
virt queue after draining. Draining is already costly and rare, so no
need to worry about a performance penalty here.

Take special care to attach the SCSI event virtqueue host notifier
with the _no_poll() variant like in virtio_scsi_dataplane_start().
This avoids the issue from the first attempted fix where the iothread
would suddenly loop with 100% CPU usage whenever some guest IO came in
[3]. This is necessary because of commit 38738f7dbb ("virtio-scsi:
don't waste CPU polling the event virtqueue"). See [4] for the
relevant discussion.

[0]: https://forum.proxmox.com/threads/137286/
[1]: https://forum.proxmox.com/threads/137536/
[2]: https://issues.redhat.com/browse/RHEL-3934
[3]: https://forum.proxmox.com/threads/138140/
[4]: https://lore.kernel.org/qemu-devel/bfc7b20c-2144-46e9-acbc-e726276c5a31@proxmox.com/

Link: https://lore.kernel.org/qemu-devel/20240202153158.788922-1-hreitz@redhat.com/
Originally-by: Fiona Ebner <f.ebner@proxmox.com>
 [ TL: Update to v2 and rebased patch series handling to v8.1.5 ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-02-02 19:35:34 +01:00
..
patches work around stuck guest IO with iothread and VirtIO block/SCSI 2024-02-02 19:35:34 +01:00
source buildsys: remove edk2 source tree when assembling build-dir 2023-05-24 10:37:10 +02:00
Logo.bmp import stable-4 build files 2017-04-05 11:39:09 +02:00
OVMF_CODE-pure-efi.fd import stable-4 build files 2017-04-05 11:39:09 +02:00
OVMF_README.txt import stable-4 build files 2017-04-05 11:39:09 +02:00
OVMF_VARS-pure-efi.fd import stable-4 build files 2017-04-05 11:39:09 +02:00
changelog bump version to 8.1.5-1 2024-02-02 19:08:16 +01:00
control d/control: add python3-venv as build-dependency 2023-10-24 15:01:23 +02:00
copyright d/copyright: drop trailing whitespace 2022-04-22 09:16:23 +02:00
docs import stable-4 build files 2017-04-05 11:39:09 +02:00
kvm-ifdown import stable-4 build files 2017-04-05 11:39:09 +02:00
kvm-ifup update to 2.9.0-rc2 build files 2017-04-05 11:40:20 +02:00
parse-cpu-flags.pl Write recognized CPUID flags into static file 2019-10-17 13:39:21 +02:00
parse-machines.pl d/parse-machines: produce stable json output 2023-05-22 15:09:14 +02:00
pve-qemu-kvm.install debian: normalize packaging files with wrap-and-sort -tkn 2023-05-22 12:05:13 +02:00
pve-qemu-kvm.links debian: normalize packaging files with wrap-and-sort -tkn 2023-05-22 12:05:13 +02:00
pve-qemu-kvm.lintian-overrides d/lintian-overrides: ignore groff line breakage/adjustment warnings 2023-05-22 15:09:14 +02:00
rules d/rules: use disable-download option instead of git-submodules=ignore 2023-10-24 15:01:23 +02:00