All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: discuss@x86-64.org
Cc: Hugh Dickins <hugh@veritas.com>, Thayne Harbaugh <thayne@c2.net>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [discuss] [PATCH] Inconsistent mmap()/mremap() flags
Date: Tue, 2 Oct 2007 15:45:32 +0200	[thread overview]
Message-ID: <200710021545.32556.ak@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0710021304230.26719@blonde.wat.veritas.com>


> First call mmap with a low hint address, the new size you'll be wanting
> from the mremap, PROT_NONE, MAP_ANONYMOUS, -1, 0.  Then call mremap with
> old address, old size, new size, MREMAP_MAYMOVE|MREMAP_FIXED, and new
> address as returned by the preparatory mmap.

That's racy unfortunately in a multithreaded process. They would need to loop.

-Andi


WARNING: multiple messages have this Message-ID (diff)
From: Andi Kleen <ak@suse.de>
To: discuss@x86-64.org
Cc: Hugh Dickins <hugh@veritas.com>, Thayne Harbaugh <thayne@c2.net>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [discuss] [PATCH] Inconsistent mmap()/mremap() flags
Date: Tue, 2 Oct 2007 15:45:32 +0200	[thread overview]
Message-ID: <200710021545.32556.ak@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0710021304230.26719@blonde.wat.veritas.com>

> First call mmap with a low hint address, the new size you'll be wanting
> from the mremap, PROT_NONE, MAP_ANONYMOUS, -1, 0.  Then call mremap with
> old address, old size, new size, MREMAP_MAYMOVE|MREMAP_FIXED, and new
> address as returned by the preparatory mmap.

That's racy unfortunately in a multithreaded process. They would need to loop.

-Andi

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-10-02 13:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-28  5:46 [PATCH] Inconsistent mmap()/mremap() flags Thayne Harbaugh
2007-09-28  5:46 ` Thayne Harbaugh
2007-10-01 11:13 ` Andi Kleen
2007-10-01 11:13   ` Andi Kleen
2007-10-02  2:57   ` Thayne Harbaugh
2007-10-02  2:57     ` Thayne Harbaugh
2007-10-02  5:15     ` Andi Kleen
2007-10-02  5:15       ` Andi Kleen
2007-10-02  7:06       ` Thayne Harbaugh
2007-10-02  7:06         ` Thayne Harbaugh
2007-10-02 12:19         ` Hugh Dickins
2007-10-02 12:19           ` Hugh Dickins
2007-10-02 13:45           ` Andi Kleen [this message]
2007-10-02 13:45             ` [discuss] " Andi Kleen
2007-10-02 14:16             ` Hugh Dickins
2007-10-02 14:16               ` Hugh Dickins
2007-10-02 15:21               ` Thayne Harbaugh
2007-10-02 15:21                 ` Thayne Harbaugh

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=200710021545.32556.ak@suse.de \
    --to=ak@suse.de \
    --cc=discuss@x86-64.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=thayne@c2.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.