From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlGxg-0001id-4Z for qemu-devel@nongnu.org; Mon, 25 Jul 2011 04:56:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlGxe-0003Am-CY for qemu-devel@nongnu.org; Mon, 25 Jul 2011 04:56:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlGxe-0003AH-5N for qemu-devel@nongnu.org; Mon, 25 Jul 2011 04:56:26 -0400 Message-ID: <4E2D2FB5.5060106@redhat.com> Date: Mon, 25 Jul 2011 10:56:21 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <4E255823.8080502@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; 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: Stefan Hajnoczi Cc: Kevin Wolf , Frediano Ziglio , qemu-devel@nongnu.org On 07/19/2011 12:57 PM, Stefan Hajnoczi wrote: > From what I understand "committed" on Windows means that physical > pages have been allocated and pagefile space has been set aside: > http://msdn.microsoft.com/en-us/library/ms810627.aspx Yes, memory that is "reserved" on Windows is just a contiguous part of the address space that is set aside, like MAP_NORESERVE under Linux. Memory that is "committed" is really allocated. > The question is how can we get the same effect on Windows and does the > current Fibers implementation not already work? Windows thread and fiber stacks have both a reserved and a committed part. The dwStackSize argument to CreateFiber indeed represents _committed_ stack size, so we're now committing 4 MB of stack per fiber. The maximum size that the stack can grow to is set to the (per-executable) default. If you want to specify both the reserved and committed stack sizes, you can do that with CreateFiberEx. http://msdn.microsoft.com/en-us/library/ms682406%28v=vs.85%29.aspx 4 MB is quite a lot of address space anyway to waste for a thread. A coroutine should not need that much, even on Linux. I think for Windows 64 KB of initial stack size and 1 MB of maximum size should do (for Linux it would 1 MB overall). Paolo