From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfsvY-0001Zy-Lw for qemu-devel@nongnu.org; Sat, 16 Jun 2012 09:20:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfsvW-0005YG-Rs for qemu-devel@nongnu.org; Sat, 16 Jun 2012 09:20:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53018) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfsvW-0005Y5-Jn for qemu-devel@nongnu.org; Sat, 16 Jun 2012 09:20:30 -0400 From: Juan Quintela In-Reply-To: <20120616094827.GL23851@valinux.co.jp> (Isaku Yamahata's message of "Sat, 16 Jun 2012 18:48:27 +0900") References: <77d2fc4b1c99e1520a7fbe873e73119ce9463592.1338802192.git.yamahata@valinux.co.jp> <87vcitshm6.fsf@elfo.mitica> <20120616094827.GL23851@valinux.co.jp> Date: Sat, 16 Jun 2012 15:19:57 +0200 Message-ID: <87vcircs1u.fsf@elfo.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 35/41] postcopy: introduce helper functions for postcopy Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: benoit.hudzia@gmail.com, aarcange@redhat.com, aliguori@us.ibm.com, kvm@vger.kernel.org, satoshi.itoh@aist.go.jp, stefanha@gmail.com, t.hirofuchi@aist.go.jp, dlaor@redhat.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, yoshikawa.takuya@oss.ntt.co.jp, owasserm@redhat.com, avi@redhat.com, pbonzini@redhat.com Isaku Yamahata wrote: > On Thu, Jun 14, 2012 at 11:34:09PM +0200, Juan Quintela wrote: >> > +size_t umem_pages_size(uint64_t nr) >> > +{ >> > + return sizeof(struct umem_pages) + nr * sizeof(uint64_t); >> >> Can we make sure that the pgoffs field is aligned? I know that as it is >> now it is aligned, but better to be sure? > > It is already done by gcc extension, zero length array. Ah, I didn't knew that propierty of the zero arrays extension. thanks. >> >> Grr, we don't have a function that writes does a "safe_write". The most >> similar thing in qemu looks to be send_all(). > > So we should introduce something like qemu_safe_write/read? I guess so. If you look around, you will see that we have a lot of cases where we have this pattern. But that is not a problem ofthis patch, was already there. > >> Talking about looking, what protects that no other thread enters this >> function before this one calls madvise? Or I am losing something obvious? > > It is assumed that only main thread calls this function via iohandler. Ok. Can we add a comment then? Later, Juan.