From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Frediano Ziglio <freddy77@gmail.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] coroutines and block I/O considerations
Date: Mon, 25 Jul 2011 10:56:21 +0200 [thread overview]
Message-ID: <4E2D2FB5.5060106@redhat.com> (raw)
In-Reply-To: <CAJSP0QXRWyotN+is=90R8CRL6M3EGZOqmDdixK27VF2ofSLnGA@mail.gmail.com>
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
next prev parent reply other threads:[~2011-07-25 8:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-19 8:06 [Qemu-devel] coroutines and block I/O considerations Frediano Ziglio
2011-07-19 10:10 ` Kevin Wolf
2011-07-19 10:57 ` Stefan Hajnoczi
2011-07-25 8:56 ` Paolo Bonzini [this message]
2011-07-25 10:00 ` Stefan Hajnoczi
2011-07-19 13:15 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E2D2FB5.5060106@redhat.com \
--to=pbonzini@redhat.com \
--cc=freddy77@gmail.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).