All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Gonglei <arei.gonglei@huawei.com>, qemu-devel@nongnu.org
Cc: peter.huangpeng@huawei.com
Subject: Re: [Qemu-devel] [PATCH v2 0/3] memory: an optimization
Date: Mon, 22 Feb 2016 11:22:36 +0100	[thread overview]
Message-ID: <56CAE16C.3060800@redhat.com> (raw)
In-Reply-To: <1456130097-4208-1-git-send-email-arei.gonglei@huawei.com>



On 22/02/2016 09:34, Gonglei wrote:
> 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(-)
> 

Thanks Lei and Fam, patches queued.

Paolo

  parent reply	other threads:[~2016-02-22 10:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Paolo Bonzini [this message]
2016-02-23  3:49   ` [Qemu-devel] [PATCH v2 0/3] memory: an optimization Fam Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56CAE16C.3060800@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.