Received: from eggs.gnu.org ([2001:4830:134:3::10]:33406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK2H7-0003Wv-Uy for qemu-devel@nongnu.org; Mon, 04 Jul 2016 07:42:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bK2H2-000461-CV for qemu-devel@nongnu.org; Mon, 04 Jul 2016 07:42:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK2H2-00045n-6V for qemu-devel@nongnu.org; Mon, 04 Jul 2016 07:42:48 -0400 References: <1467104499-27517-1-git-send-email-pl@kamp.de> <1467104499-27517-8-git-send-email-pl@kamp.de> <87bn2i6a0z.fsf@dusky.pond.sub.org> <5e0cdb47-1446-e575-a1c7-c437ac7b8e41@redhat.com> <87vb0llkic.fsf@dusky.pond.sub.org> From: Paolo Bonzini Message-ID: Date: Mon, 4 Jul 2016 13:42:42 +0200 MIME-Version: 1.0 In-Reply-To: <87vb0llkic.fsf@dusky.pond.sub.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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: Markus Armbruster Cc: Peter Lieven , kwolf@redhat.com, peter.maydell@linaro.org, mst@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, kraxel@redhat.com, dgilbert@redhat.com On 04/07/2016 13:18, Markus Armbruster wrote: > Paolo Bonzini writes: > >> On 30/06/2016 16:12, Markus Armbruster wrote: >>> Implementing a stack as "big enough" array can be wasteful. >>> Implementing it as dynamically allocated list is differently wasteful. >>> Saving several mallocs and frees can be worth "wasting" a few pages of >>> memory for a short time. >> >> Most usage of QmpInputVisitor at startup comes from >> object_property_set_qobject, which only sets small scalar objects. The >> stack is entirely unused in this case. > > A quick test run shows ~300 qmp_input_visitor_new() calls during > startup, with at most two alive at the same time. > > Why would it matter whether these are in the order of 150 bytes or 25000 > bytes each? How could this materially impact RSS? I think we agree that it doesn't. The question in the subthread is whether we can improve QmpInputVisitor in general. Paolo