From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHq9N-0002Jw-DJ for qemu-devel@nongnu.org; Tue, 28 Jun 2016 06:21:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHq9J-0004j0-BF for qemu-devel@nongnu.org; Tue, 28 Jun 2016 06:21:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHq9J-0004im-5V for qemu-devel@nongnu.org; Tue, 28 Jun 2016 06:21:45 -0400 Date: Tue, 28 Jun 2016 11:21:39 +0100 From: "Daniel P. Berrange" Message-ID: <20160628102139.GH13019@redhat.com> Reply-To: "Daniel P. Berrange" References: <1467104499-27517-1-git-send-email-pl@kamp.de> <1467104499-27517-8-git-send-email-pl@kamp.de> <20160628092918.GD2243@work-vm> <577245B7.3090502@kamp.de> <20160628101058.GG13019@redhat.com> <20160628101759.GF2243@work-vm> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160628101759.GF2243@work-vm> Subject: Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: Peter Lieven , kwolf@redhat.com, peter.maydell@linaro.org, mst@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, kraxel@redhat.com, pbonzini@redhat.com On Tue, Jun 28, 2016 at 11:17:59AM +0100, Dr. David Alan Gilbert wrote: > * Daniel P. Berrange (berrange@redhat.com) wrote: > > On Tue, Jun 28, 2016 at 11:39:03AM +0200, Peter Lieven wrote: > > > Am 28.06.2016 um 11:29 schrieb Dr. David Alan Gilbert: > > > > * Peter Lieven (pl@kamp.de) wrote: > > > > > this struct is approx 75kB > > > > I wonder why it's so large. > > > > > > > > The stack size in QmpInputVisitor; it's got a 1024 element stack > > > > (QIV_STACK_SIZE) and I bet we never use anywhere near that. > > > > > > > > But even then that's 1024 * a 3 pointer stack object, 24 bytes - > > > > I don't see where the rest of that 75kB comes from. > > > > > > Sorry, I had a wrong size in mind. Its 24736 bytes. But thats > > > still larger than expecetd, right? > > > > > > > I'm a little wary about turning all these malloc's into mmap's > > > > because we do seem to use things like input visitors for small > > > > things; don't the cost of doing the mmap's add up in time > > > > instead of space? > > > > > > Sure, we should discuss this. The series should act as a base for > > > discussion. > > > > > > None of the things I changed into mmap are continously called > > > during VM runtime. So it most likely only happens at setup of the > > > vServer. > > > > QmpInputVisitor is used to parse all QMP monitor commands, so will > > be used continuously throughout life of QEMU, often very frequently. > > eg When migration is running many monitor commands per second are > > expected > > Does the same input visitor get reused by each command? Opps, actually no i'm wrong, its only used by the 'object_add' command but that does allocate a new one for each invokation. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|