qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Frediano Ziglio <freddy77@gmail.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] coroutines and block I/O considerations
Date: Tue, 19 Jul 2011 11:57:30 +0100	[thread overview]
Message-ID: <CAJSP0QXRWyotN+is=90R8CRL6M3EGZOqmDdixK27VF2ofSLnGA@mail.gmail.com> (raw)
In-Reply-To: <4E255823.8080502@redhat.com>

On Tue, Jul 19, 2011 at 11:10 AM, Kevin Wolf <kwolf@redhat.com> wrote:
> Am 19.07.2011 10:06, schrieb Frediano Ziglio:
>> 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).

>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

On Linux memory is overcommitted and will not require swap space or
any actual pages.  This behavior can be configured differently IIRC
but the default is to be lazy about claiming memory resources so that
even 4 MB thread/coroutine stacks are not an issue.

The question is how can we get the same effect on Windows and does the
current Fibers implementation not already work?

Stefan

  reply	other threads:[~2011-07-19 10:57 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 [this message]
2011-07-25  8:56     ` Paolo Bonzini
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='CAJSP0QXRWyotN+is=90R8CRL6M3EGZOqmDdixK27VF2ofSLnGA@mail.gmail.com' \
    --to=stefanha@gmail.com \
    --cc=freddy77@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).