Bug 730128

Summary: qemu-kvm takes very long to start with large initrd
Product: [Fedora] Fedora Reporter: Albert Strasheim <fullung>
Component: qemuAssignee: Fedora Virtualization Maintainers <virt-maint>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 17CC: amit.shah, berrange, crobinso, dwmw2, fullung, itamar, jaswinder, jforbes, knoel, mads, rjones, scottt.tw, tburke, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-25 15:25:35 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Albert Strasheim 2011-08-11 16:39:23 EDT
Description of problem:

It takes qemu-kvm about 40 seconds to start booting the kernel if the -initrd specifies a initramfs of 150 MB.

Once the kernel starts booting, it boots within 4 seconds, all the way through systemd to the console.

qemu-kvm seems to be doing something strange.

Version-Release number of selected component (if applicable):

qemu-system-x86-0.14.0-7.fc15.x86_64

kernel 2.6.38.8-32.fc15.x86_64

How reproducible:

Always

Steps to Reproduce:
1. sudo yum -y --releasever=15 --installroot `pwd`/root install bash systemd
2. cd root; ln -s /sbin/init
3. find . | sudo cpio -o -H newc | gzip > ../initramfs.img
4. qemu-kvm -m 4096M -nographic -net none -kernel root/boot/vmlinuz-2.6.38.8-35.fc15.x86_64 -append "console=ttyS0 selinux=0 clocksource=hpet ipv6.disable=1 plymouth.enable=0 rd.plymouth=0" -initrd initramfs.img

Actual results:

qemu-kvm takes about 40 seconds before the kernel starts booting.

Expected results:

qemu-kvm should boot fast

Additional info:

Hardware is a Mac Pro with 2* Intel Xeon E5462 CPUs and 20 GB RAM.
Comment 1 Fedora Admin XMLRPC Client 2012-03-15 13:53:20 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 2 Daniel Berrange 2012-04-18 08:26:50 EDT
Changing to rawhide, since this basically affects all QEMU versions in Fedora & we don't want it auto-closed when F15 goes EOL.
Comment 3 Cole Robinson 2012-07-10 09:24:06 EDT
*** Bug 618720 has been marked as a duplicate of this bug. ***
Comment 4 Cole Robinson 2012-07-10 09:25:26 EDT
Rawhide bugs just tend to linger, so moving to F17. 

I thought I saw commits go by about fixing this with qemu 1.1, but can't find them now. Here's older info from Rich's report:

The root cause is possibly:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=7972995b0c346de76

See discussion here:
http://lists.gnu.org/archive/html/qemu-devel/2010-08/threads.html#00133
Comment 5 Richard W.M. Jones 2012-07-10 09:31:56 EDT
I'm fairly sure this is going to be a problem in qemu
forever since upstream devs don't want to change the
way that the initrd is loaded to make it more efficient.

In libguestfs we sidestepped the issue by not using an
initrd to load the appliance.
Comment 6 Cole Robinson 2013-05-25 15:25:35 EDT
I'm quite certain that more recent qemu has improved on this, so closing. And as Rich mentioned even if there are still issues, the substantial speedups were rejected in the past.