From: "Michael S. Tsirkin" <mst@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, Jaya Tiwari <tiwari.jaya18@gmail.com>
Subject: Re: [Qemu-devel] [PATCH V2 1/1] virtio:Allocate temporary VirtQueueElementOld on heap
Date: Tue, 15 Mar 2016 11:40:12 +0200 [thread overview]
Message-ID: <20160315113837-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <56E7D2D0.4010009@redhat.com>
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
prev parent reply other threads:[~2016-03-15 9:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-11 16:12 [Qemu-devel] [PATCH 1/1] Allocating Large sized arrays to heap Jaya Tiwari
2016-03-14 14:20 ` Paolo Bonzini
2016-03-14 15:40 ` [Qemu-devel] [PATCH V2 1/1] virtio:Allocate temporary VirtQueueElementOld on heap Jaya Tiwari
2016-03-15 7:02 ` Michael S. Tsirkin
2016-03-15 7:36 ` Jaya Tiwari
2016-03-15 9:16 ` Paolo Bonzini
2016-03-15 9:40 ` Michael S. Tsirkin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160315113837-mutt-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=tiwari.jaya18@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).