From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aflSd-0004UM-Rp for qemu-devel@nongnu.org; Tue, 15 Mar 2016 05:40:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aflSZ-0001W0-RT for qemu-devel@nongnu.org; Tue, 15 Mar 2016 05:40:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aflSZ-0001Vw-M1 for qemu-devel@nongnu.org; Tue, 15 Mar 2016 05:40:15 -0400 Date: Tue, 15 Mar 2016 11:40:12 +0200 From: "Michael S. Tsirkin" Message-ID: <20160315113837-mutt-send-email-mst@redhat.com> References: <56E6C89F.5030503@redhat.com> <1457970015-3181-1-git-send-email-tiwari.jaya18@gmail.com> <20160315090036-mutt-send-email-mst@redhat.com> <56E7D2D0.4010009@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56E7D2D0.4010009@redhat.com> Subject: Re: [Qemu-devel] [PATCH V2 1/1] virtio:Allocate temporary VirtQueueElementOld on heap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Jaya Tiwari On Tue, Mar 15, 2016 at 10:16:00AM +0100, Paolo Bonzini wrote: > > > 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 Hmm, I got confused. You are right. I'll redo the review, sorry about the noise. -- MST