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: Anthony Liguori
Subject: Re: [Qemu-devel] coroutines and block I/O considerations
Date: Tue, 19 Jul 2011 08:15:47 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

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



reply via email to

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