qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] coroutine: use AioContext for CoQueue BH


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH] coroutine: use AioContext for CoQueue BH
Date: Wed, 6 Mar 2013 16:41:01 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Am 06.03.2013 um 15:53 hat Stefan Hajnoczi geschrieben:
> CoQueue uses a BH to awake coroutines that were made ready to run again
> using qemu_co_queue_next() or qemu_co_queue_restart_all().  The BH
> currently runs in the iothread AioContext and would break coroutines
> that run in a different AioContext.
> 
> This is a slightly tricky problem because the lifetime of the BH exceeds
> that of the CoQueue.  This means coroutines can be awoken after CoQueue
> itself has been freed.

Does this really happen in practice? If so, that sounds like a bug to
me.

> Finally, I don't want to move unlock_queue and unlock_bh into
> AioContext.  That would break encapsulation - AioContext isn't supposed
> to know about CoQueue.

So what you would need here is "AioContext local storage". I wonder if
this will stay a requirement unique to CoQueues when AioContexts gain
wider use.

Kevin



reply via email to

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