qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] QEMU/CPC project: an experience report


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] QEMU/CPC project: an experience report
Date: Fri, 11 Oct 2013 11:35:36 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]