linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Phi Debian <phi.debian@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: bugzilla-daemon@bugzilla.kernel.org, linux-mm@kvack.org,
	 Rik van Riel <riel@redhat.com>, Hugh Dickins <hughd@google.com>
Subject: Re: [Bug 207861] New: mremap MAP_ANONYMOUS|MAP_SHARED grow provide bad mapping.
Date: Tue, 26 May 2020 13:40:54 +0200	[thread overview]
Message-ID: <CAJOr74hm=wVzVJMkf3NwOwV=Oj1RGEWnTRW6OC0GefwXoSNAOQ@mail.gmail.com> (raw)
In-Reply-To: <20200524174021.f37b8fd9b9ffa9fafab0970e@linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 1043 bytes --]

Hi All,

Following up, I think I got the big picture with what you said, and then I
think, that 'may be' there is no real use case for
MAP__ANONYMOUS|MAP_SHARED, well I guess we can even say there is none
otherwise they would have voiced long ago :) I got trapped into it in a
multithreaded app trying to be smart and grow the regions that way :). I
guess this could be closed with a simple little notice in the man page,
eventually in the BUGS section, specifying that using mremap() on
MAP_SHARED is not supported beside the virtual addr aliasing already
mentioned. I got trapped after rereading again and again the fine manual,
and thinking for a minute I must miss something.

Note that MAP__ANONYMOUS|MAP_SHARED works nicely, and this one is very
useful to implement performant 'realloc' without copy for page (multipages)
realloc, with all the precaution that no addr of the memory region got to
be taken due to the vaddr migration potential, that's already mentioned in
the man page.

So the fix is simply docco I guess :)

Cheers,
Phi

[-- Attachment #2: Type: text/html, Size: 1236 bytes --]

      reply	other threads:[~2020-05-26 11:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-207861-27@https.bugzilla.kernel.org/>
2020-05-25  0:40 ` Andrew Morton
2020-05-26 11:40   ` Phi Debian [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='CAJOr74hm=wVzVJMkf3NwOwV=Oj1RGEWnTRW6OC0GefwXoSNAOQ@mail.gmail.com' \
    --to=phi.debian@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bugzilla-daemon@bugzilla.kernel.org \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=riel@redhat.com \
    /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