From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] coroutine: use AioContext for CoQueue BH
Date: Wed, 6 Mar 2013 16:41:01 +0100 [thread overview]
Message-ID: <20130306154101.GD2285@dhcp-200-207.str.redhat.com> (raw)
In-Reply-To: <1362581603-21777-1-git-send-email-stefanha@redhat.com>
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
next prev parent reply other threads:[~2013-03-06 15:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 14:53 [Qemu-devel] [PATCH] coroutine: use AioContext for CoQueue BH Stefan Hajnoczi
2013-03-06 15:03 ` Paolo Bonzini
2013-03-07 10:09 ` Stefan Hajnoczi
2013-03-06 15:41 ` Kevin Wolf [this message]
2013-03-07 10:25 ` Stefan Hajnoczi
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=20130306154101.GD2285@dhcp-200-207.str.redhat.com \
--to=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).