qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/3] memory: an optimization
@ 2016-02-22  8:34 Gonglei
  2016-02-22  8:34 ` [Qemu-devel] [PATCH v2 1/3] exec: store RAMBlock pointer into memory region Gonglei
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Gonglei @ 2016-02-22  8:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Gonglei, peter.huangpeng

Perf top tells me qemu_get_ram_ptr consume some cpu cycles.

Before this optimization:
  1.26%  qemu-kvm                  [.] qemu_get_ram_ptr
  0.89%  qemu-kvm                  [.] qemu_get_ram_block

Applied the patch set:
 0.87%  qemu-kvm                 [.] qemu_get_ram_ptr

And Paolo suggested that we can get rid of qemu_get_ram_ptr
by storing the RAMBlock pointer into the memory region,
instead of the ram_addr_t value. And after appling this change,
I got much better performance indeed.

BTW, PATCH 3 is an occasional find.

v2:
 - using 'struct RAMBlock *' instead of 'void *' in patch 1 [Fam]
 - drop superfluous comments in patch 1 [Fam]

Gonglei (3):
  exec: store RAMBlock pointer into memory region
  memory: optimize qemu_get_ram_ptr and qemu_ram_ptr_length
  memory: Remove the superfluous code

 exec.c                | 48 ++++++++++++++++++++++++++++++------------------
 include/exec/memory.h |  8 ++++----
 memory.c              |  3 ++-
 3 files changed, 36 insertions(+), 23 deletions(-)

-- 
1.8.5.2

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

end of thread, other threads:[~2016-02-23  3:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-22  8:34 [Qemu-devel] [PATCH v2 0/3] memory: an optimization Gonglei
2016-02-22  8:34 ` [Qemu-devel] [PATCH v2 1/3] exec: store RAMBlock pointer into memory region Gonglei
2016-02-22  8:34 ` [Qemu-devel] [PATCH v2 2/3] memory: optimize qemu_get_ram_ptr and qemu_ram_ptr_length Gonglei
2016-02-22  8:34 ` [Qemu-devel] [PATCH v2 3/3] memory: Remove the superfluous code Gonglei
2016-02-22 10:22 ` [Qemu-devel] [PATCH v2 0/3] memory: an optimization Paolo Bonzini
2016-02-23  3:49   ` Fam Zheng

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).