qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 5/7] coroutine: rewrite pool to avoid mutex


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 5/7] coroutine: rewrite pool to avoid mutex
Date: Tue, 02 Dec 2014 13:32:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0


On 02/12/2014 13:18, Peter Lieven wrote:
> On 02.12.2014 13:13, Paolo Bonzini wrote:
>>
>> On 02/12/2014 13:09, Peter Lieven wrote:
>>>> -static void __attribute__((destructor)) coroutine_pool_cleanup(void)
>>>> -{
>>>> -    Coroutine *co;
>>>> -    Coroutine *tmp;
>>>> -
>>>> -    QSLIST_FOREACH_SAFE(co, &pool, pool_next, tmp) {
>>>> -        QSLIST_REMOVE_HEAD(&pool, pool_next);
>>>> -        qemu_coroutine_delete(co);
>>>> -    }
>>>> -
>>>> -    qemu_mutex_destroy(&pool_lock);
>>>> -}
>>>> -
>>> I still feel we should leave this destructor in to clean up the
>>> release_pool.
>> Why?  If you run QEMU under valgrind, there are thousands of blocks that
>> we do not free.  Stefan/Kevin, what do you think?
> 
> Before this patch we cleaned up this part at least.
> I have learned that it bad style not to clean up your resources.
> Just because other code parts do not do it we should not introduce
> new parts that don't it.

Which other parts do we cleanup?  For example file descriptors are not
cleaned up, much less most memory; the kernel is there to do it for us.
 I think it's up to the maintainers to decide.

Paolo



reply via email to

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