qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Frediano Ziglio <freddy77@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] coroutines and block I/O considerations
Date: Tue, 19 Jul 2011 08:15:47 -0500	[thread overview]
Message-ID: <4E258383.6040609@codemonkey.ws> (raw)
In-Reply-To: <4E255823.8080502@redhat.com>

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

      parent reply	other threads:[~2011-07-19 13:15 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
2011-07-25 10:00       ` Stefan Hajnoczi
2011-07-19 13:15   ` Anthony Liguori [this message]

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=4E258383.6040609@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=freddy77@gmail.com \
    --cc=kwolf@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).