qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Lieven <pl@kamp.de>
Cc: quintela@redhat.com, qemu-devel@nongnu.org,
	xiaoguangrong@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH] migration: drop MADVISE_DONT_NEED for incoming zero pages
Date: Mon, 07 Oct 2013 11:43:22 +0200	[thread overview]
Message-ID: <5252823A.5050500@redhat.com> (raw)
In-Reply-To: <1381137738-4231-1-git-send-email-pl@kamp.de>

Il 07/10/2013 11:22, Peter Lieven ha scritto:
> The madvise for zeroed out pages was introduced when every transferred
> zero page was memset to zero and thus allocated. Since commit
> 211ea740 we check for zeroness of a target page before we memset
> it to zero. Additionally we memmap target memory so it is essentially
> zero initalized (except for e.g. option roms and bios which are loaded
> into target memory altough they shouldn't). 
> 
> It was reported recently that this madvise causes a performance degradation
> in some situations. As the madvise should only be called rarely and if its called
> it is likely on a busy page (it was non-zero and changed to zero during migration)
> drop it completely.
> 
> Signed-off-by: Peter Lieven <pl@kamp.de>
> Reported-By: Zhang Haoyu <haoyu.zhang@huawei.com>
> ---
>  arch_init.c |    8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/arch_init.c b/arch_init.c
> index 7545d96..e0acbc5 100644
> --- a/arch_init.c
> +++ b/arch_init.c
> @@ -850,14 +850,6 @@ void ram_handle_compressed(void *host, uint8_t ch, uint64_t size)
>  {
>      if (ch != 0 || !is_zero_range(host, size)) {
>          memset(host, ch, size);
> -#ifndef _WIN32
> -        if (ch == 0 && (!kvm_enabled() || kvm_has_sync_mmu())) {
> -            size = size & ~(getpagesize() - 1);
> -            if (size > 0) {
> -                qemu_madvise(host, size, QEMU_MADV_DONTNEED);
> -            }
> -        }
> -#endif
>      }
>  }
>  
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

  reply	other threads:[~2013-10-07  9:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-07  9:22 [Qemu-devel] [PATCH] migration: drop MADVISE_DONT_NEED for incoming zero pages Peter Lieven
2013-10-07  9:43 ` Paolo Bonzini [this message]
2013-10-07  9:57 ` Andreas Färber

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=5252823A.5050500@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=pl@kamp.de \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=xiaoguangrong@linux.vnet.ibm.com \
    /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 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).