Closed Bug 1455485 Opened 6 years ago Closed 5 years ago

Update Android emulator to 27.1.7 or newer to get QEMU 2.9 with multithreaded support

Categories

(Testing :: General, enhancement, P3)

Version 3
enhancement

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: ted, Assigned: gbrown)

References

Details

QEMU 2.9 introduced a feature called tcg-multithread:
https://wiki.qemu.org/Features/tcg-multithread

And the Android emulator 2.7.17 release includes QEMU 2.9:
https://developer.android.com/studio/releases/emulator.html#27-1-7

We should try updating the emulator we use in automation to pick this up. If our AVDs don't already contain multiple virtual CPUs we would have to change that for this to be useful.
Thanks Ted.

I think I have already tried 27.1.7 and did not see a significant improvement, but I'll double-check anyway.

(We are currently having a close look at standing up a modern x86 android emulator with kvm acceleration on packet.net, as an alternative for future android testing.)
Summary: Update Android emulator to 2.7.17 or newer to get QEMU 2.9 with multithreaded support → Update Android emulator to 27.1.7 or newer to get QEMU 2.9 with multithreaded support
Assignee: nobody → gbrown
Blocks: 1425322
Priority: -- → P1
Emulator 27.1.12 (March 2018) with latest Android 4.3 system images:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=2458d9d598825973e228fbe7eb2229504dcfafaf

 - I see no significant performance improvements
 - there are a lot of reftest failures + some new mochitest and geckoview-junit failures
I determined the cause of the geckoview-junit failures and fixed those:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=7e47fc65e7d9fb0c10a4e2793257154760b45d50

The reftest and mochitest failures remain unresolved.
:jchen - Can you have a look at the failures in comment 2 (other than gv-junit)? What can we do about these?
Flags: needinfo?(nchen)
See Also: → 1285678
Blocks: 1463035
For bug 1463035, do we need a newer emulator for the newer 4.3 AVD? Does the old emulator not work? I seem to remember running the newer 4.3 AVD fine with the old emulator.
Flags: needinfo?(nchen)
When I run the newer 4.3 AVD with the old emulator, I get:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=214a38df9d471c0fc95672c33417b2acc34f230b

https://treeherder.mozilla.org/logviewer.html#?job_id=181376366&repo=try&lineNumber=1286

PROCESS-CRASH | remoteautomation.py | application crashed [@ mozilla::gl::GLContextEGL::GLContextEGL(mozilla::gl::CreateContextFlags, mozilla::gl::SurfaceCaps const&, bool, void*, void*, void*)]
Moving to p3 because no activity for at least 24 weeks.
See https://github.com/mozilla/bug-handling/blob/master/policy/triage-bugzilla.md#how-do-you-triage for more information
Priority: P1 → P3
A new try push (new avd + new emulator), since android mochitests have had a lot of attention lately (for bug 1460411):

https://treeherder.mozilla.org/#/jobs?repo=try&revision=71d919a9245fe5454b1e4da143f7df77ee30b33f

 - there are many reftest failures
 - there are a few xpcshell, robocop, mochitest failures
 - all tests seem to run 10-30% slower compared to current tests on mozilla-central
In another context, :snorp suggested that changing the avd's hw.lcd.density=160 might help with the reftest problems, so I tried that, but I do not see a significant change:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=2b5ca29343f8b67c3a6a44402e2e0b33c29d1bea
Someone will need to investigate and/or skip the failing tests before proceeding here. But even so, as far as I can tell, there is no performance improvement, so -- other than enabling bug 1463035 -- there may not be an advantage anyway.
Assignee: gbrown → nobody
Just curious: are you using stock AVDs? I think to get any benefit out of this you'd need to change the number of emulated CPUs. The docs on managing AVDs list a "Emulated Performance: Multi-Core CPU (Advanced)" setting:
https://developer.android.com/studio/run/managing-avds#avdproperties
I pass -cores on the command line and set hw.cpu.ncore, but I think both are rejected:

emulator: WARNING: Classic QEMU doesn't support -cores option, only one
virtual CPU can be emulated with this engine.

and

emulator: WARNING: Classic qemu does not support SMP. The hw.cpu.ncore option from your config file is ignored.

I believe ranchu/qemu2 refuses to run android 4.3. ranchu + newer android is possible on arm, and I believe does not complain about cores, but performance is terrible. I don't have a try push, but you can see it locally with 'mach android-emulator --version 7.0' -- just booting android takes several minutes!
Assignee: nobody → gbrown
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX

Can you explain why wontfix? Because of this bug, we're testing with an unrealistically old kernel (as in, no supported version of Android uses such an old kernel on real devices), which can cause problems.

Of course, sorry.

I don't know of a way to upgrade the emulator without hitting the problems reported in comment 8 and all Android 4.3 tests are scheduled to be retired (no longer run on trunk) as of September 2019 anyway.

Android 7.0 tests are running today and will continue to run on version 28+ of the emulator, or on real devices on bitbar.

You need to log in before you can comment on or make changes to this bug.