qemu-user-static
qemu-user-static copied to clipboard
Speed is very slow in user-mode emulation for mips64 arch
Is this a bug report, feature (enhancement) request or question? (leave only one on its own line)
/kind question
Description:
Using qemu-mips64el-static
and image mips64el aoqi/debian-mips64el:oldstable
to compile bazel application, it will very slow with javac ...
in debug output(it's not still finished in 10m above). However, it will costs 1m ~ 2m to finish javac command in x86_64 container). In mips64el container, speed is too slow.
Steps to reproduce the issue:
-
start
x86_64 debian:stretch
(since debian:stretch has java 8), and startmips64el aoqi/debian-mips64el:oldstable
(https://hub.docker.com/r/aoqi/debian-mips64el) withqemu-mips64el-static
in another terminal -
install openjdk-8-jdk etc. development tools, and download it from https://github.com/bazelbuild/bazel/releases/download/2.0.0/bazel-2.0.0-dist.zip and then extract it
-
start compile with below similar command
root@container:/home/bazel-2.0# pwd
/home/bazel-2.0
root@container:/home/bazel-2.0# PATH=/usr/lib/ccache:$PATH EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk --explain /tmp/LOG --verbose_explanations --compilation_mode fastbuild --verbose_failures --show_progress --subcommands --show_timestamps --color yes" VERBOSE=yes BAZEL_DEBUG_JAVA_COMPILATION=1 BAZEL_JAVAC_OPTS="-J-Xmx6g -J-Xms4g" bash compile.sh
Describe the results you received:
Using mips64el aoqi/debian-mips64el:oldstable
to compile it, it will very slow with javac ...
in debug output. However, it will costs 1m ~ 2m to finish javac command in x86_64 container):
root@container:/home/bazel-2.0# ...... bash compile
... ...
tools/java/runfiles/Runfiles.java
tools/java/runfiles/Util.java
/usr/lib/jvm/java-8-openjdk-amd64/bin/javac -classpath ... ...
... ...
Describe the results you expected:
I know about that performance will decrease using qemu user mode, but it's abnormal for so slow speed in qemu-mips64el-static. It is a normal phenomenon?
Environment:
- x86_64 host
[yancy@asus github]$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
[yancy@asus github]$ uname -a
Linux asus 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
https://kojipkgs.fedoraproject.org/packages/qemu/4.0.0/5.fc31/x86_64/qemu-user-static-4.0.0-5.fc31.x86_64.rpm
[yancy@asus github]$ qemu-mips64el-static --version
qemu-mips64el version 4.0.0 (qemu-4.0.0-5.fc31)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers
[yancy@asus github]$ cat /proc/sys/fs/binfmt_misc/qemu-mips64el
enabled
interpreter /usr/bin/qemu-mips64el-static
flags:
offset 0
magic 7f454c4602010100000000000000000002000800
mask ffffffffffffff000000000000000000feffffff
[yancy@asus github]$ rpm -qa docker-ce
docker-ce-19.03.5-3.el7.x86_64
[yancy@asus github]$ docker version
Client: Docker Engine - Community
Version: 19.03.5
API version: 1.40
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:25:41 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.5
API version: 1.40 (minimum version 1.12)
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:24:18 2019
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: 1.2.10
GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version: 1.0.0-rc8+dev
GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
docker-init:
Version: 0.18.0
GitCommit: fec3683
- qemu-mips64el container
root@container:/home/bazel-2.0-mips64# uname -m
mips64
root@container:/home/bazel-2.0-mips64# java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1~deb9u1-b10)
OpenJDK 64-Bit Zero VM (build 25.222-b10, interpreted mode)
root@container:/home/bazel-2.0-mips64# qemu-mips64el-static --version
qemu-mips64el version 4.0.0 (qemu-4.0.0-5.fc31)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers