From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmQ6G-0007cx-RP for qemu-devel@nongnu.org; Thu, 28 Jul 2011 08:54:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QmQ6F-00043z-MP for qemu-devel@nongnu.org; Thu, 28 Jul 2011 08:54:04 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:53080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmQ6F-00043s-Jo for qemu-devel@nongnu.org; Thu, 28 Jul 2011 08:54:03 -0400 Received: by gxk26 with SMTP id 26so2112601gxk.4 for ; Thu, 28 Jul 2011 05:54:03 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4E31578E.2080704@redhat.com> References: <20110728120931.GB17045@lst.de> <4E31578E.2080704@redhat.com> Date: Thu, 28 Jul 2011 13:54:03 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Block layer roadmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: devin122@gmail.com, Jes Sorensen , Jagane Sundar , Dor Laor , qemu-devel , Markus Armbruster , Feiran Zheng , Frediano Ziglio , Paolo Bonzini , Christoph Hellwig On Thu, Jul 28, 2011 at 1:35 PM, Kevin Wolf wrote: > Am 28.07.2011 14:09, schrieb Christoph Hellwig: >> On Wed, Jul 27, 2011 at 01:37:31PM +0100, Stefan Hajnoczi wrote: >>> Coroutines in the block layer [Kevin] >>> =A0* Programming model to simplify block drivers without blocking QEMU = threads >> >> Can anyone explain what the whole point of this is? =A0It really just is >> a bit of syntactic sugar for the current async state machines. =A0What d= oes >> it buy us over going for real threading? > > The only current block driver that really does everything in an async > state machine is qed. It's definitely not nice code, and having to > convert all of the other block drivers to this would be a lot of work. Thanks Kevin :). I do agree with the clumsiness of async callback programming - a lot of code is spent bundling and unbundling variables to pass between functions, not to mention that the control flow is much harder to follow. > So if it only means that we're making things async that would block the > VCPU until now, isn't that a great improvement already? > > The advantage compared to threading is that it allows an easy and > incremental transition. Also remember that we already have a threads-based implementation of coroutines. Later on we can do fine-grained locking and switch to threads directly instead of coroutines, if need be. Stefan