From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT7Yv-0004Gg-6p for qemu-devel@nongnu.org; Mon, 07 Oct 2013 05:57:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VT7Yo-0000o0-1M for qemu-devel@nongnu.org; Mon, 07 Oct 2013 05:57:13 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38185 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT7Yn-0000no-Qm for qemu-devel@nongnu.org; Mon, 07 Oct 2013 05:57:05 -0400 Message-ID: <5252856E.4090907@suse.de> Date: Mon, 07 Oct 2013 11:57:02 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1381137738-4231-1-git-send-email-pl@kamp.de> In-Reply-To: <1381137738-4231-1-git-send-email-pl@kamp.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] migration: drop MADVISE_DONT_NEED for incoming zero pages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , quintela@redhat.com Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, xiaoguangrong@linux.vnet.ibm.com Am 07.10.2013 11:22, schrieb Peter Lieven: > 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 "initialized" > into target memory altough they shouldn't).=20 "although" >=20 > It was reported recently that this madvise causes a performance degrada= tion > in some situations. As the madvise should only be called rarely and if = its called "it's" > it is likely on a busy page (it was non-zero and changed to zero during= migration) > drop it completely. >=20 > Signed-off-by: Peter Lieven > Reported-By: Zhang Haoyu Please case "Reported-by" and place above Sob. Juan, will you be picking this one up or do we need a respin? Cheers, Andreas > --- > arch_init.c | 8 -------- > 1 file changed, 8 deletions(-) >=20 > 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 !=3D 0 || !is_zero_range(host, size)) { > memset(host, ch, size); > -#ifndef _WIN32 > - if (ch =3D=3D 0 && (!kvm_enabled() || kvm_has_sync_mmu())) { > - size =3D size & ~(getpagesize() - 1); > - if (size > 0) { > - qemu_madvise(host, size, QEMU_MADV_DONTNEED); > - } > - } > -#endif > } > } > =20 >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg