From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPWe0-0004RC-Fr for qemu-devel@nongnu.org; Tue, 09 Apr 2013 07:23:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPWdz-0008Js-9N for qemu-devel@nongnu.org; Tue, 09 Apr 2013 07:23:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPWdz-0008Jl-2R for qemu-devel@nongnu.org; Tue, 09 Apr 2013 07:23:19 -0400 From: Juan Quintela In-Reply-To: <1365418028-2546-1-git-send-email-pbonzini@redhat.com> (Paolo Bonzini's message of "Mon, 8 Apr 2013 12:47:08 +0200") References: <1365418028-2546-1-git-send-email-pbonzini@redhat.com> Date: Tue, 09 Apr 2013 13:23:19 +0200 Message-ID: <87li8sdk2g.fsf@elfo.elfo> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] migration: initialize RAM to zero Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@gmail.com, pl@kamp.de, qemu-devel@nongnu.org, owasserm@redhat.com Paolo Bonzini wrote: > 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). > > Signed-off-by: Paolo Bonzini Except for the mmap return check and the missing valgrind check, the patch looks good. Thanks, Juan.