From: "Emilio G. Cota" <cota@braap.org>
To: "Etienne Dublé" <etienne.duble@imag.fr>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] qemu-user performance
Date: Fri, 16 Nov 2018 10:41:36 -0500 [thread overview]
Message-ID: <20181116154136.GA19765@flamenco> (raw)
In-Reply-To: <04fcf478-29c3-67be-74bb-fd26975fe441@imag.fr>
On Fri, Nov 16, 2018 at 14:55:01 +0100, Etienne Dublé wrote:
(snip)
> So the idea is: what if we could share the cache of code already translated
> between all those processes?
> There would be sereral ways to achieve this:
> * use a shared memory area for the cache, and locking mechanisms.
> * have a (maybe optional) daemon that would manage the cache of all
> processes.
> * python-like model: the first time a binary or library is translated, save
> this translated code in a cache file next to the original file, with
> different extension.
> Please let me know what you think about it, if something similar has already
> been studied, or if I miss something obvious.
There's a recent paper that implements something similar to what you
propose:
"A General Persistent Code Caching Framework for Dynamic Binary
Translation (DBT)", ATC'16
https://www.usenix.org/system/files/conference/atc16/atc16_paper-wang.pdf
Note that in that paper they compare against HQEMU, and not against
upstream QEMU. I presume they chose HQEMU because it spends
more effort than QEMU in trying to generate better code for hot
code paths (they use LLVM in a separate thread for those), which
means that code generation can be a bottleneck for some workloads
(e.g. SPEC's gcc or perlbench).
QEMU, on the other hand, generates much simpler code, and as a result
it is rare to find workloads where code generation is a bottleneck.
(You can measure this with perf top in your system; make sure you
configured QEMU with --disable-strip to keep the symbols after
"make install".)
So until QEMU gets some sort of "hot code optimization" that makes
translation more expensive, there's little point in implementing
persistent code caching for it.
As an aside, what QEMU version are you running? Performance has
improved quite a bit (particularly for integer workloads) in the
last couple of years, e.g. see the perf improvements from v2.6 to
v2.11 here:
https://imgur.com/a/5P5zj
Cheers,
Emilio
next prev parent reply other threads:[~2018-11-16 15:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-16 13:55 [Qemu-devel] qemu-user performance Etienne Dublé
2018-11-16 15:41 ` Emilio G. Cota [this message]
2018-11-16 16:46 ` Etienne Dublé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181116154136.GA19765@flamenco \
--to=cota@braap.org \
--cc=etienne.duble@imag.fr \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).