[Regression]Powerpc kvm guest unable to start with hugepage backed memory
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Current upstream qemu master does not boot a powerpc kvm guest backed by hugepage.
HW: Power9 (DD2.3)
Host Kernel: 5.6.0-rc5
Guest Kernel: 5.6.0-rc5
Qemu: ba29883206d92a2
Steps to reproduce:
1. Allocate enough hugepage to boot a KVM guest
# cat /proc/meminfo |grep ^HugePages
HugePages_Total: 5000
HugePages_Free: 5000
HugePages_Rsvd: 0
HugePages_Surp: 0
2. Define and boot a guest
/usr/bin/
Starting install...
ERROR internal error: qemu unexpectedly closed the monitor: qemu-system-ppc64: util/qemu-
qemu-system-ppc64: util/qemu-
-----------NOK
Bisected the issue to below commit.
037fb5eb3941c80
commit 037fb5eb3941c80
Author: bauerchen <email address hidden>
Date: Tue Feb 11 17:10:35 2020 +0800
mem-prealloc: optimize large guest startup
[desc]:
Large memory VM starts slowly when using -mem-prealloc, and
there are some areas to optimize in current method;
1、mmap will be used to alloc threads stack during create page
clearing threads, and it will attempt mm->mmap_sem for write
lock, but clearing threads have hold read lock, this competition
will cause threads createion very slow;
2、methods of calcuating pages for per threads is not well;if we use
64 threads to split 160 hugepage,63 threads clear 2page,1 thread
clear 34 page,so the entire speed is very slow;
to solve the first problem,we add a mutex in thread function,and
start all threads when all threads finished createion;
and the second problem, we spread remainder to other threads,in
situation that 160 hugepage and 64 threads, there are 32 threads
clear 3 pages,and 32 threads clear 2 pages.
[test]:
320G 84c VM start time can be reduced to 10s
680G 84c VM start time can be reduced to 18s
Signed-off-by: bauerchen <email address hidden>
Reviewed-by: Pan Rui <email address hidden>
Reviewed-by: Ivan Ren <email address hidden>
[Simplify computation of the number of pages per thread. - Paolo]
Signed-off-by: Paolo Bonzini <email address hidden>
util/oslib-posix.c | 32 +++++++
1 file changed, 24 insertions(+), 8 deletions(-)
bisect log:
# git bisect log
git bisect start
# good: [52901abf94477b
git bisect good 52901abf94477b4
# bad: [ba29883206d92a
git bisect bad ba29883206d92a2
# good: [d1ebbc9d16297b
git bisect good d1ebbc9d16297b5
# good: [87b74e8b6edd28
git bisect good 87b74e8b6edd287
# bad: [e0175b71638cf4
git bisect bad e0175b71638cf43
# bad: [ca6155c0f2bd39
git bisect bad ca6155c0f2bd39b
# good: [ab74e543112957
git bisect good ab74e5431129576
# good: [cb06fdad05f3e5
git bisect good cb06fdad05f3e54
# bad: [037fb5eb3941c8
git bisect bad 037fb5eb3941c80
# good: [88e2b97aa3e369
git bisect good 88e2b97aa3e369a
# good: [b1db8c63169f21
git bisect good b1db8c63169f213
# good: [e5c59355ae9f72
git bisect good e5c59355ae9f724
# good: [920d557e5ae586
git bisect good 920d557e5ae5867
# first bad commit: [037fb5eb3941c8
Qemu cmdline:
```
/home/sath/
-name guest=vm1,
-S \
-object secret,
-machine pseries-
-m 8192 \
-mem-prealloc \
-mem-path /dev/hugepages/
-overcommit mem-lock=off \
-smp 8,sockets=
-uuid e5875dd8-
-display none \
-no-user-config \
-nodefaults \
-chardev socket,
-mon chardev=
-rtc base=utc \
-no-shutdown \
-boot strict=on \
-kernel /home/kvmci/
-append 'root=/dev/sda5 rw console=tty0 console=
-device qemu-xhci,
-device virtio-
-device virtio-
-drive file=/home/
-device scsi-hd,
-netdev tap,fd=
-device virtio-
-chardev pty,id=charserial0 \
-device spapr-vty,
-chardev socket,
-device virtserialport,
-device virtio-
-msg timestamp=on
2020-03-11 08:11:46.639+0000: 494632: info : libvirt version: 5.6.0, package: 5.fc31 (Fedora Project, 2019-11-
2020-03-11 08:11:46.639+0000: 494632: info : hostname: ltcmihawk50.
2020-03-11 08:11:46.639+0000: 494632: info : virObjectUnref:349 : OBJECT_UNREF: obj=0x7fff3c0f6fb0
char device redirected to /dev/pts/2 (label charserial0)
qemu-system-ppc64: util/qemu-
qemu-system-ppc64: util/qemu-
2020-03-11 08:11:47.195+0000: shutting down, reason=failed
```
summary: |
- Powerpc kvm guest unable to start with hugepage backed + Powerpc kvm guest unable to start with hugepage backed memory |
summary: |
- Powerpc kvm guest unable to start with hugepage backed memory + [Regression]Powerpc kvm guest unable to start with hugepage backed + memory |
Any updates?