Closed Bug 928463 Opened 11 years ago Closed 11 years ago

Investigate using kvm acceleration for Android x86 emulation

Categories

(Testing :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: gbrown, Assigned: gbrown)

References

Details

I thought that we looked into kvm before and found that it could not be used in our environment, but I can find no evidence of that now.

If we can use kvm, it might improve our test run-times.
On the loaner ix box, I followed these instructions:

http://developer.android.com/tools/devices/emulator.html
https://help.ubuntu.com/community/KVM/Installation

Specifically:

sudo apt-get install cpu-checker
sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
sudo adduser cltbld libvirtd

I did not install virt-manager; I did not need to chown anything.

To verify installation:

[cltbld@talos-linux64-ix-001.test.releng.scl3.mozilla.com ~]$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
[cltbld@talos-linux64-ix-001.test.releng.scl3.mozilla.com ~]$ virsh -c qemu:///system list
 Id Name                 State
----------------------------------

[cltbld@talos-linux64-ix-001.test.releng.scl3.mozilla.com ~]$ ls -l /dev/kvm
crw-rw----+ 1 root kvm 10, 232 Oct 18 10:30 /dev/kvm
I added these command line options when starting the emulator:

-qemu -m 512 -enable-kvm

(this must be at the *end* of the command line).

I tried running reftest-1 (of 10 chunks) against nightly. It completed in under 5 minutes!! (Previously only completed 80% of the tests in 60 minutes.)

Running full tests suite now...
Over the weekend, I ran the full test suite on the loaner with kvm several times. I found no significant regressions due to kvm: A few extra tests pass and/or fail, so manifests will need an update, but no major changes to results.

The run times are fantastic: All reftests and mochitests run much, much faster, while Robocop and xpcshell run at about the same rate.

The reftest and mochitest speedup is sufficient to allow us to run R, C, JSR, and M jobs as just one chunk each. However, for R, tests often fail with OOM errors if run as one chunk; they run fine in 2 chunks.

Sample run times with kvm:

M:    22 minutes
M-gl:  2 minutes
R1:   23 minutes
R2:   22 minutes
C:    11 minutes
JSR:   5 minutes

This is great!
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.