qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 4/4] coroutine: pool coroutines to speed up c


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v2 4/4] coroutine: pool coroutines to speed up creation
Date: Thu, 12 May 2011 12:38:37 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10

Am 12.05.2011 12:22, schrieb Stefan Hajnoczi:
> On Thu, May 12, 2011 at 11:13 AM, Kevin Wolf <address@hidden> wrote:
>> terAm 12.05.2011 11:54, schrieb Stefan Hajnoczi:
>>> This patch speeds up coroutine creation by reusing freed coroutines.
>>> When a coroutine terminates it is placed in the pool instead of having
>>> its resources freed.  The next time a coroutine is created it can be
>>> taken straight from the pool and requires no initialization.
>>>
>>> Performance results on an Intel Core2 Duo T9400 (2.53GHz) for
>>> ./check-coroutine --benchmark-lifecycle 20000000:
>>>
>>>   No pooling:    19.5 sec
>>>   With pooling:   1.1 sec
>>>
>>> Signed-off-by: Stefan Hajnoczi <address@hidden>
>>> ---
>>>  check-coroutine.c    |    2 ++
>>>  qemu-coroutine-int.h |    2 ++
>>>  qemu-coroutine.c     |   49 
>>> ++++++++++++++++++++++++++++++++++++++++++++++---
>>>  qemu-coroutine.h     |    9 +++++++++
>>>  vl.c                 |    2 ++
>>>  5 files changed, 61 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/check-coroutine.c b/check-coroutine.c
>>> index 5a42c49..223c50c 100644
>>> --- a/check-coroutine.c
>>> +++ b/check-coroutine.c
>>> @@ -218,6 +218,8 @@ int main(int argc, char **argv)
>>>      };
>>>      int i;
>>>
>>> +    qemu_coroutine_init();
>>
>> Can we use module_init instead of adding an explicit call to main()?
>> This would prevent forgetting to add it in qemu-img and qemu-io like in
>> this patch.
> 
> module_init what? :)  qemu-img/qemu-io only init MODULE_INIT_BLOCK so
> we'd have to modify them anyway.

Right... I was thinking of block, but in fact coroutines are not limited
to the block layer, so we would abuse it.

> I don't want to add qemu-img/qemu-io things yet because we don't have
> a block layer user for coroutines yet.  The qcow2 patches should
> contain these changes.

I hope we won't forget it. A missing atexit isn't a very obvious bug.

Kevin



reply via email to

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