From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UP7lV-0000u6-Mj for qemu-devel@nongnu.org; Mon, 08 Apr 2013 04:49:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UP7lT-0005Oz-3u for qemu-devel@nongnu.org; Mon, 08 Apr 2013 04:49:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UP7lS-0005On-Sy for qemu-devel@nongnu.org; Mon, 08 Apr 2013 04:49:23 -0400 Date: Mon, 8 Apr 2013 10:49:14 +0200 From: Kevin Wolf Message-ID: <20130408084914.GD2657@dhcp-200-207.str.redhat.com> References: <1364291919-19563-1-git-send-email-pl@kamp.de> <1364291919-19563-7-git-send-email-pl@kamp.de> <20130405192327.GG2351@dhcp-200-207.str.redhat.com> <49B72003-C5C1-4109-806F-260F3522BD5B@kamp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49B72003-C5C1-4109-806F-260F3522BD5B@kamp.de> Subject: Re: [Qemu-devel] [PATCHv5 06/10] migration: search for zero instead of dup pages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: Anthony Liguori , quintela@redhat.com, Stefan Hajnoczi , qemu-devel@nongnu.org, Orit Wasserman , Paolo Bonzini Am 08.04.2013 um 10:33 hat Peter Lieven geschrieben: > > Am 05.04.2013 um 21:23 schrieb Kevin Wolf : > > > Am 26.03.2013 um 10:58 hat Peter Lieven geschrieben: > >> virtually all dup pages are zero pages. remove > >> the special is_dup_page() function and use the > >> optimized buffer_find_nonzero_offset() function > >> instead. > >> > >> here buffer_find_nonzero_offset() is used directly > >> to avoid the unnecssary additional checks in > >> buffer_is_zero(). > >> > >> raw performace gain checking 1 GByte zeroed memory > >> over is_dup_page() is approx. 10-12% with SSE2 > >> and 8-10% with unsigned long arithmedtic. > >> > >> Signed-off-by: Peter Lieven > >> Reviewed-by: Orit Wasserman > >> Reviewed-by: Eric Blake > > > > Okay, so I bisected again and this is the second patch that is involved > > in the slowness of qemu-iotests case 007. > > > > Can you try if the following solves your issue: > > diff --git a/exec.c b/exec.c > index 786987a..54baa4a 100644 > --- a/exec.c > +++ b/exec.c > @@ -1071,6 +1071,7 @@ ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host, > memory_try_enable_merging(new_block->host, size); > } > } > + qemu_madvise(new_block->host, size, QEMU_MADV_DONTNEED); > new_block->length = size; > > /* Keep the list sorted from biggest to smallest block. */ It does. But perhaps Paolo's suggestion of using mmap() to allocate the memory would be better. I'm not sure how MADV_DONTNEED behaves on non-Linux. Kevin