From: Stefan Hajnoczi <stefanha@gmail.com>
To: Gabriel Kerneis <gabriel@kerneis.info>
Cc: Charlie Shepherd <charlie@ctshepherd.com>,
google-summer-of-code-mentors-list@googlegroups.com,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] QEMU/CPC project: an experience report
Date: Fri, 11 Oct 2013 11:35:36 +0200 [thread overview]
Message-ID: <20131011093536.GD28383@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <20131010221422.GA4378@kerneis.info>
On Thu, Oct 10, 2013 at 11:14:22PM +0100, Gabriel Kerneis wrote:
> We were so excited about our QEMU/CPC GSoC project that we have decided
> to write a 12-page article to share our experience:
>
> QEMU/CPC: static analysis and CPS conversion
> for safe, portable, and efficient coroutines
> http://gabriel.kerneis.info/research/files/qemu-cpc.pdf
>
> If you want to learn more about QEMU internals, how we fixed hundreds of
> lines of code with a small checking tool, or discover a nice compilation
> technique for coroutines, you will probably be interested in this
> article.
Summary & status:
Charlie showed it's possible to use the CPC tool to implement QEMU
coroutines. CPC is a source-to-source translator that outputs C code.
That means no stack switching or threads are necessary to implement
coroutines. In other words, high performance coroutines that are also
portable.
There are still some challenges so QEMU cannot switch to CPC yet. Not
all existing QEMU coroutine code is amenable to CPC translation, work is
needed to refactor the code to remove functions that change behavior
depending on if (qemu_in_coroutine()). Also, CPC is not yet widely
packaged and available on all QEMU host platforms so we cannot add it as
a build dependency at this time.
The paper offers details on how CPC works, tools that Gabriel and
Charlie developed and refined during the Google Summer of Code project,
and performance results.
The most immediate result is that a tool will soon be available to check
coroutine_fn annotations in the QEMU source tree. The tool can detect
code paths where a yielding function is invoked outside coroutine
context (which would result in an abort at runtime!).
Thanks to Charlie Shepherd and Gabriel Kerneis, it was a pleasure
working together!
Stefan
next prev parent reply other threads:[~2013-10-11 9:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-10 22:14 [Qemu-devel] QEMU/CPC project: an experience report Gabriel Kerneis
2013-10-11 9:35 ` Stefan Hajnoczi [this message]
2013-10-11 11:34 ` [Qemu-devel] [GSoC Mentors] " Pierre Tardy
2013-10-11 11:47 ` [Qemu-devel] " Gabriel Kerneis
2013-10-11 12:05 ` Pierre Tardy
2013-10-11 14:34 ` [Qemu-devel] [GSoC Mentors] " Gabriel Kerneis
2013-11-12 21:25 ` [Qemu-devel] " Gabriel Kerneis
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=20131011093536.GD28383@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=charlie@ctshepherd.com \
--cc=gabriel@kerneis.info \
--cc=google-summer-of-code-mentors-list@googlegroups.com \
--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).