Received: from eggs.gnu.org ([2001:4830:134:3::10]:48194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4QX4-0005VQ-4X for qemu-devel@nongnu.org; Thu, 03 Dec 2015 04:50:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4QWz-0003Dt-OR for qemu-devel@nongnu.org; Thu, 03 Dec 2015 04:50:33 -0500 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:50587) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4QWz-0003De-FY for qemu-devel@nongnu.org; Thu, 03 Dec 2015 04:50:29 -0500 Received: from localhost by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 3 Dec 2015 09:50:28 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 7363717D8067 for ; Thu, 3 Dec 2015 09:50:55 +0000 (GMT) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tB39oQJH65994986 for ; Thu, 3 Dec 2015 09:50:26 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tB39oQSL019742 for ; Thu, 3 Dec 2015 02:50:26 -0700 Date: Thu, 3 Dec 2015 10:50:23 +0100 From: Greg Kurz Message-ID: <20151203105023.6fcd239a@bahia.local> In-Reply-To: <1449131887-27071-1-git-send-email-mst@redhat.com> References: <1449131887-27071-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] mmap-alloc: tweak a comment on ppc64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Paolo Bonzini , qemu-devel@nongnu.org On Thu, 3 Dec 2015 10:38:10 +0200 "Michael S. Tsirkin" wrote: > The comment I put in mmap-alloc to document the ppc64 rules > refers to the previous revision of the patch: > we don't look at memory alignment anymore, we check > the fs from which the fd is mapped, instead. > > It's also not clear what does "in this case" refer > to, rearrange text to make it clearer. > > Signed-off-by: Michael S. Tsirkin > --- This is better indeed. Thanks ! Reviewed-by: Greg Kurz > util/mmap-alloc.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c > index 54793a5..5cd7f71 100644 > --- a/util/mmap-alloc.c > +++ b/util/mmap-alloc.c > @@ -50,10 +50,11 @@ void *qemu_ram_mmap(int fd, size_t size, size_t align, bool shared) > #if defined(__powerpc64__) && defined(__linux__) > /* On ppc64 mappings in the same segment (aka slice) must share the same > * page size. Since we will be re-allocating part of this segment > - * from the supplied fd, we should make sure to use the same page size, > - * unless we are using the system page size, in which case anonymous memory > - * is OK. Use align as a hint for the page size. > - * In this case, set MAP_NORESERVE to avoid allocating backing store memory. > + * from the supplied fd, we should make sure to use the same page size, to > + * this end we mmap the supplied fd. In this case, set MAP_NORESERVE to > + * avoid allocating backing store memory. > + * We do this unless we are using the system page size, in which case > + * anonymous memory is OK. > */ > int anonfd = fd == -1 || qemu_fd_getpagesize(fd) == getpagesize() ? -1 : fd; > int flags = anonfd == -1 ? MAP_ANONYMOUS : MAP_NORESERVE;