qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V2 1/1] virtio:Allocate temporary VirtQueueEleme


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH V2 1/1] virtio:Allocate temporary VirtQueueElementOld on heap
Date: Tue, 15 Mar 2016 10:16:00 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0


On 15/03/2016 08:36, Jaya Tiwari wrote:
> 
>     This is not what that page suggests. It says:
>     Make the stack array
>     smaller and allocate on the heap in the rare case that the
>     data does not fit in the small array:
> 
>     This patch just uses heap unconditionally which is sure to hurt
>     performance.

This is not a hot path.  It only happens when saving/loading data after
migration.  Surely the few microseconds wasted in allocating data on the
heap are beaten by zeroing the memory, by all the for loops in the
functions, and of course by the 3-500 *milli*seconds of downtime caused
by migration.

> Yes Okay.
> Thank you for pointing it out.
> So I should be including a condition to check with a small stack size,
> and if the array crosses it, only then
> it should be placed in heap, otherwise it should not be using heap.
> Am I correct in my understanding here? 

Jaya, this patch is okay.  What Michael said is true in other cases, but
not this one.

Paolo



reply via email to

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