|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [Qemu-devel] [PATCH] memory: reduce heap Rss size around 3M |
Date: | Wed, 8 Mar 2017 08:17:53 -0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 |
On 03/08/2017 12:11 PM, Yang Zhong wrote:
Since cpu-memory and memory have same address space,one malloced memory is enough. This patch will skip memory malloc for memory address space,which will reduce around 3M physical memory in heap. Signed-off-by: Yang Zhong <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
--- memory.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/memory.c b/memory.c index 284894b..799ca4c 100644 --- a/memory.c +++ b/memory.c @@ -2422,8 +2422,10 @@ AddressSpace *address_space_init_shareable(MemoryRegion *root, const char *name) AddressSpace *as; QTAILQ_FOREACH(as, &address_spaces, address_spaces_link) { - if (root == as->root && as->malloced) { - as->ref_count++; + if (root == as->root) { + if (as->malloced) { + as->ref_count++; + } return as; } }
[Prev in Thread] | Current Thread | [Next in Thread] |