From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDGSq-0001bH-7T for qemu-devel@nongnu.org; Wed, 06 Mar 2013 10:41:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDGSm-0005Ye-N3 for qemu-devel@nongnu.org; Wed, 06 Mar 2013 10:41:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:22381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDGSm-0005YT-Ft for qemu-devel@nongnu.org; Wed, 06 Mar 2013 10:41:04 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r26Ff36v014942 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 6 Mar 2013 10:41:03 -0500 Date: Wed, 6 Mar 2013 16:41:01 +0100 From: Kevin Wolf Message-ID: <20130306154101.GD2285@dhcp-200-207.str.redhat.com> References: <1362581603-21777-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1362581603-21777-1-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH] coroutine: use AioContext for CoQueue BH List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Paolo Bonzini , qemu-devel@nongnu.org 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