qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor
Date: Mon, 04 Jul 2016 13:18:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Paolo Bonzini <address@hidden> 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?

There's one type of waste here that I understand: we zero the whole
QmpInputVisitor on allocation.

I'm not opposed to changing how the stack is implemented, I just want to
first understand why the current implmementation behaves badly (assuming
it does).



reply via email to

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