Received: from eggs.gnu.org ([208.118.235.92]:48392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPqAB-0004R4-83 for qemu-devel@nongnu.org; Wed, 10 Apr 2013 04:13:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPqAA-0000HM-0e for qemu-devel@nongnu.org; Wed, 10 Apr 2013 04:13:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30876) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPqA9-0000HH-Nq for qemu-devel@nongnu.org; Wed, 10 Apr 2013 04:13:49 -0400 From: Markus Armbruster References: <1365522223-20153-1-git-send-email-pbonzini@redhat.com> Date: Wed, 10 Apr 2013 10:03:46 +0200 In-Reply-To: <1365522223-20153-1-git-send-email-pbonzini@redhat.com> (Paolo Bonzini's message of "Tue, 9 Apr 2013 17:43:43 +0200") Message-ID: <87k3oavml9.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v3] migration: initialize RAM to zero List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, aliguori@us.ibm.com, quintela@redhat.com, pl@kamp.de, qemu-devel@nongnu.org, owasserm@redhat.com, stefanha@redhat.com Paolo Bonzini writes: > Using qemu_memalign only leaves the RAM zero by chance, because libc > will usually use mmap to satisfy our huge requests. But memory will > not be zero when using MALLOC_PERTURB_ with a nonzero value. In the > case of incoming migration, this breaks a recently-introduced > invariant (commit f1c7279, migration: do not sent zero pages in > bulk stage, 2013-03-26). > > To fix this, use mmap ourselves to get a well-aligned, always zero > block for the RAM. Mmap-ed memory is easy to "trim" at the sides. > > This also removes the need to do something special on valgrind > (see commit c2a8238a, Support running QEMU on Valgrind, 2011-10-31), > thus effectively reverts that patch. > > Reviewed-by: Juan Quintela > Signed-off-by: Paolo Bonzini Reviewed-by: Markus Armbruster