From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjA9Q-0006EG-Jt for qemu-devel@nongnu.org; Tue, 19 Jul 2011 09:15:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjA9O-0007yH-NA for qemu-devel@nongnu.org; Tue, 19 Jul 2011 09:15:52 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:56037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjA9O-0007yA-7G for qemu-devel@nongnu.org; Tue, 19 Jul 2011 09:15:50 -0400 Received: by gwb19 with SMTP id 19so1971542gwb.4 for ; Tue, 19 Jul 2011 06:15:49 -0700 (PDT) Message-ID: <4E258383.6040609@codemonkey.ws> Date: Tue, 19 Jul 2011 08:15:47 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <4E255823.8080502@redhat.com> In-Reply-To: <4E255823.8080502@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] coroutines and block I/O considerations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Frediano Ziglio , qemu-devel@nongnu.org On 07/19/2011 05:10 AM, Kevin Wolf wrote: > Am 19.07.2011 10:06, schrieb Frediano Ziglio: > They are still all running in the same thread. > >> 2- memory considerations on coroutines. Beside coroutines allow more >> readable code I wonder if somebody considered memory. For every >> coroutines a different stack has to be allocated. For instance >> ucontext and win32 implementation use 4mb. Assuming 128 concurrent AIO >> this require about 512mb of ram (mostly only committed but not used >> and coroutines are reused). > > 128 concurrent requests is a lot. And even then, it's only virtual > memory. I doubt that we're actually using much more than we do in the > old code with the AIOCBs (which will disappear and become local > variables when we complete the conversion). A 4mb stack is probably overkill anyway. It's easiest to just start with a large stack and then once all of the functionality is worked out, optimize to a smaller stack. The same problem exists with using threads FWIW since the default thread stack is usually quite large. Regards, Anthony Liguori