qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3] memory: reduce heap Rss size around 3M
@ 2017-03-15 13:39 Yang Zhong
  2017-03-15  8:12 ` Paolo Bonzini
  0 siblings, 1 reply; 6+ messages in thread
From: Yang Zhong @ 2017-03-15 13:39 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, anthony.xu, Yang Zhong

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 <yang.zhong@intel.com>
---
 memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/memory.c b/memory.c
index 64b0a60..0003b1e 100644
--- a/memory.c
+++ b/memory.c
@@ -2422,7 +2422,7 @@ 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) {
+        if (root == as->root && as == &address_space_memory) {
             as->ref_count++;
             return as;
         }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-03-15 13:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-15 13:39 [Qemu-devel] [PATCH v3] memory: reduce heap Rss size around 3M Yang Zhong
2017-03-15  8:12 ` Paolo Bonzini
2017-03-15  8:20   ` Zhong, Yang
2017-03-15 10:41   ` Peter Maydell
2017-03-15 12:49     ` Zhong, Yang
2017-03-15 13:04       ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).