Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 849500 - app-emulation/qemu-7.0.0: IO-threads stuck in 100% CPU usage - Patch exists
Summary: app-emulation/qemu-7.0.0: IO-threads stuck in 100% CPU usage - Patch exists
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal major
Assignee: John Helmert III
URL: https://gitlab.com/qemu-project/qemu/...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2022-06-03 12:02 UTC by Gunnar Eggen
Modified: 2022-06-04 03:01 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Upstream patch (file_849500.txt,67 bytes, text/plain)
2022-06-03 12:04 UTC, Gunnar Eggen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gunnar Eggen 2022-06-03 12:02:13 UTC
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
Comment 1 Gunnar Eggen 2022-06-03 12:04:47 UTC
Created attachment 782483 [details]
Upstream patch

Upstream patch
Comment 2 Larry the Git Cow gentoo-dev 2022-06-04 03:01:39 UTC
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(-)