qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <gkurz@linux.vnet.ibm.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] mmap-alloc: tweak a comment on ppc64
Date: Thu, 3 Dec 2015 10:50:23 +0100	[thread overview]
Message-ID: <20151203105023.6fcd239a@bahia.local> (raw)
In-Reply-To: <1449131887-27071-1-git-send-email-mst@redhat.com>

On Thu, 3 Dec 2015 10:38:10 +0200
"Michael S. Tsirkin" <mst@redhat.com> 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 <mst@redhat.com>
> ---

This is better indeed. Thanks !

Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com>

>  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;

      reply	other threads:[~2015-12-03  9:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-03  8:38 [Qemu-devel] [PATCH] mmap-alloc: tweak a comment on ppc64 Michael S. Tsirkin
2015-12-03  9:50 ` Greg Kurz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151203105023.6fcd239a@bahia.local \
    --to=gkurz@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).