Stalls frequently while under load

Bug #732223 reported by Loïc Minier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro QEMU
Fix Released
High
Unassigned

Bug Description

Hi

I apologize for the lack of details, but when running qemu-system-arm with a Linaro vexpress kernel, I get frequent stalls which make it barely usable :-/

I'm starting qemu-linaro on a fast (c1.medium) EC2 instance which seems to behave normally in general. It's maverick based and I use qemu-linaro 2011.03: 0.14.50-2011.03-1-0ubuntu1~ppa10.10.1
I'm creating a SD card image with linaro-media-create with something like:

./linaro-media-create --image_file qemu.img --hwpack hwpack_linaro-vexpress_20110309-0_armel_supported.tar.gz --image_size 10G --dev vexpress --rootfs ext4 --binary linaro-n-developer-tar-20110309-0.tar.gz --hwpack-force-yes.

I'm launching qemu with something like:
qemu-system-arm -M vexpress-a9 -kernel ~/vmlinuz-2.6.38-1000-linaro-vexpress -nographic -append "serialtty=ttyAMA0,38400 console=ttyAMA0,38400 root=/dev/mmcblk0p2" -initrd ~/initrd.img-2.6.38-1000-linaro-vexpress -sd qemu.img

and install openssh; I connected over a -redir 2022::22 connection and run apt-get install from either serial console or from the SSH session, in both cases it hangs pretty badly, but it seems that the console session remains a bit more responsive to key presses.

Thanks,

Revision history for this message
Loïc Minier (lool) wrote :

As a data point, I tried running the images from:
http://people.debian.org/~aurel32/qemu/armel/
and they didn't hang (with the same qemu-linaro version).

The difference are numerous:
* different model
* quite different kernels
* different userspaces (notably ARMv7 Thumb-2 vs. ARMv4T)
* different root types (notably SD versus SCSI over PCI)

I tried booting the Debian image using -sd instead of -hda, but didn't work -- the module isn't in the kernel nor in the initramfs, so no SD card gets detected.

Booting the Debian image using the Ubuntu kernel + initrd and -hda wouldn't work as vexpress has no PCI, so I tried with -sd (so basically a Debian userspace and everything else from Ubuntu); this seemed pretty stable to me. Under load I did see some much shorter stalls when doing CPU intensive tasks, but much less so, they felt more natural and didn't trigger while just apt-get update-ing for instance.

So this might very well be a problem with ARMv7 + Thumb-2 userspace :-/

Revision history for this message
Loïc Minier (lool) wrote :

I found a pathological use case with debian-installer; as soon as one tries to partition the SD card, QEMU hangs and doesn't seem to return. If it's pre-partitioned, if one tries to mkfs.ext4 it, it hangs at 33% of a 512 MiB disk with a single primary partition and takes an awful amount of time to continue from the 33% mark.

To reproduce, create a 512 MiB sd.img file, download files from http://ports.ubuntu.com/ubuntu-ports/dists/oneiric/main/installer-armel/current/images/linaro-vexpress/netboot/ and run:
qemu-system-arm -M vexpress-a9 -kernel vmlinuz -initrd initrd.gz -append "foo" -m 1024 -sd sd.img

when partitioning, select to partition manually and use the first partition as /; don't setup any swap.

Peter Maydell (pmaydell)
Changed in qemu-linaro:
status: New → Confirmed
importance: Undecided → High
Changed in qemu-linaro:
assignee: nobody → Dr. David Alan Gilbert (davidgil-uk)
Revision history for this message
Dr. David Alan Gilbert (davidgil-uk) wrote :

Hi Loic,
  Instead of your:

qemu-system-arm -M vexpress-a9 -kernel vmlinuz -initrd initrd.gz -append "foo" -m 1024 -sd sd.img

can you try with:

qemu-system-arm -M vexpress-a9 -kernel vmlinuz -initrd initrd.gz -append "foo" -m 1024 -drive file=sd.img,if=sd,cache=writeback

and verify that it's happy?

For me this gives me about 50x speed improvement for vexpress sd card write performance and doesn't hang during the mkfs.

Dave

Revision history for this message
Loïc Minier (lool) wrote :

Oh gosh, yes, that's helping dramatically; mkfs.ext4 completes instantly; thanks!

Not sure whether it's a bug or not though?

Revision history for this message
Dr. David Alan Gilbert (davidgil-uk) wrote :

> Oh gosh, yes, that's helping dramatically; mkfs.ext4 completes instantly; thanks!

> Not sure whether it's a bug or not though?

having the default be unusable seems like a bug to me.

Michael Hope (michaelh1)
Changed in qemu-linaro:
assignee: Dr. David Alan Gilbert (davidgil-uk) → nobody
Revision history for this message
Peter Maydell (pmaydell) wrote :

The default for SD cards is now cache=writeback (both in qemu-linaro and upstream) so I'm closing this bug. If it's still a problem please feel free to reopen with fresh info.

Changed in qemu-linaro:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.