qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] coroutines and block I/O considerations


From: Paolo Bonzini
Subject: Re: [Qemu-devel] coroutines and block I/O considerations
Date: Mon, 25 Jul 2011 10:56:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]