[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor |
Date: |
Tue, 28 Jun 2016 13:36:03 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 |
On 28/06/2016 11:01, Peter Lieven wrote:
> this struct is approx 75kB
>
> Signed-off-by: Peter Lieven <address@hidden>
> ---
> qapi/qmp-input-visitor.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Can you change the stack to a QSLIST instead? That's where most of the
waste comes from.
Thanks,
Paolo
> diff --git a/qapi/qmp-input-visitor.c b/qapi/qmp-input-visitor.c
> index aea90a1..b6f5dfd 100644
> --- a/qapi/qmp-input-visitor.c
> +++ b/qapi/qmp-input-visitor.c
> @@ -17,6 +17,7 @@
> #include "qapi/qmp-input-visitor.h"
> #include "qapi/visitor-impl.h"
> #include "qemu/queue.h"
> +#include "qemu/mmap-alloc.h"
> #include "qemu-common.h"
> #include "qapi/qmp/types.h"
> #include "qapi/qmp/qerror.h"
> @@ -378,14 +379,14 @@ Visitor *qmp_input_get_visitor(QmpInputVisitor *v)
> void qmp_input_visitor_cleanup(QmpInputVisitor *v)
> {
> qobject_decref(v->root);
> - g_free(v);
> + qemu_anon_ram_munmap(v, sizeof(*v));
> }
>
> QmpInputVisitor *qmp_input_visitor_new(QObject *obj, bool strict)
> {
> QmpInputVisitor *v;
>
> - v = g_malloc0(sizeof(*v));
> + v = qemu_anon_ram_mmap(sizeof(*v));
>
> v->visitor.type = VISITOR_INPUT;
> v->visitor.start_struct = qmp_input_start_struct;
>
- [Qemu-devel] [PATCH 09/15] loader: use mmap for ROMs, (continued)
- [Qemu-devel] [PATCH 09/15] loader: use mmap for ROMs, Peter Lieven, 2016/06/28
- [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor, Peter Lieven, 2016/06/28
- Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor, Dr. David Alan Gilbert, 2016/06/28
- Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor, Peter Lieven, 2016/06/28
- Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor, Daniel P. Berrange, 2016/06/28
- Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor, Dr. David Alan Gilbert, 2016/06/28
- Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor, Daniel P. Berrange, 2016/06/28
- Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor, Eric Blake, 2016/06/28
Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor,
Paolo Bonzini <=
Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor, Markus Armbruster, 2016/06/30
[Qemu-devel] [PATCH 10/15] vmware_svga: use mmap for scratch pad, Peter Lieven, 2016/06/28
[Qemu-devel] [PATCH 04/15] coroutine: add a knob to disable the shared release pool, Peter Lieven, 2016/06/28
[Qemu-devel] [PATCH 05/15] util: add a helper to mmap private anonymous memory, Peter Lieven, 2016/06/28
[Qemu-devel] [PATCH 06/15] exec: use mmap for subpages, Peter Lieven, 2016/06/28
Re: [Qemu-devel] [PATCH 00/15] optimize Qemu RSS usage, Paolo Bonzini, 2016/06/28