QEmu 7.0.0 have a bug that makes the IO-threads related to virtio-scsi take up 100% CPU all the time. The bug is identified here: https://gitlab.com/qemu-project/qemu/-/issues/997 And apparently fixed here: https://lists.gnu.org/archive/html/qemu-devel/2022-04/msg04724.html However this patch seems not to have made it to any release, and I'm having a hard time finding out if it's to be released in a upcoming minor version or not. QEmu development is pretty confusing and non-transparent for amateurs like me... This is pretty nasty bug performance wise, and since 7.0.0 is in gentoo stable and older versions has been removed I was hoping we could implement the patch on the gentoo side until it makes it to an official release. Reproducible: Always Steps to Reproduce: 1. Install current stable QEmu 7.0.0-r1 2. Create a VM which uses virtio-scsi 3. Check CPU usage on the host and observe a constant 100% CPU on all IO threads Actual Results: The IO threads uses 100% CPU constantly Expected Results: Normal CPU usage depending on load
Created attachment 782483 [details] Upstream patch Upstream patch
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a2440aa2b4c8ceaf4195e30f6b4888ede061d8dd commit a2440aa2b4c8ceaf4195e30f6b4888ede061d8dd Author: Sam James <sam@gentoo.org> AuthorDate: 2022-06-04 02:59:28 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-06-04 03:01:29 +0000 app-emulation/qemu: backport virtio-iscsi CPU usage fix; FORTIFY_SOURCE=3 fixes - Backport virtio-iscsi CPU usage fix; - Don't force -D_FORTIFY_SOURCE=2 (we patch it into toolchain so need to set it, and by doing -U... -D...=2, it prevents usage of =3) - Backport FORTIFY_SOURCE=3 crash fix Closes: https://bugs.gentoo.org/849587 Closes: https://bugs.gentoo.org/849500 Signed-off-by: Sam James <sam@gentoo.org> .../qemu-7.0.0-pci-overflow-fortify-source-3.patch | 94 +++ .../qemu/files/qemu-7.0.0-virtio-scsi-fixes.patch | 182 ++++ app-emulation/qemu/qemu-7.0.0-r2.ebuild | 922 +++++++++++++++++++++ app-emulation/qemu/qemu-9999.ebuild | 36 +- 4 files changed, 1220 insertions(+), 14 deletions(-)