From: Hugh Dickins <hugh@veritas.com>
To: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Gleb Natapov <gleb@minantech.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Petr Vandrovec <vandrove@vc.cvut.cz>,
Nick Piggin <nickpiggin@yahoo.com.au>,
Badari Pulavarty <pbadari@us.ibm.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Nick's core remove PageReserved broke vmware...
Date: Thu, 10 Nov 2005 13:10:07 +0000 (GMT) [thread overview]
Message-ID: <Pine.LNX.4.61.0511101251060.7127@goblin.wat.veritas.com> (raw)
In-Reply-To: <20051108213407.GB31746@mellanox.co.il>
On Tue, 8 Nov 2005, Michael S. Tsirkin wrote:
>
> Hugh, did you have something like the following in mind
> (this is only boot-tested and only on x86-64)?
Yes, that looks pretty good to me, a few comments below.
Only another twenty or so architectures to go ;)
(I had been imagining VM_DONTCOPY plus another flag to say set by the
user: better your way, we would like to merge these vmas, and VM_DONTCOPY
is in that peculiar list of special flags that prevent merging.)
> Hmm, maybe MADV_INHERIT and MADV_DONT_INHERIT would be better names,
You're right, and it would be a good choice, except that MAP_INHERIT on
some OSes has a particular meaning (about inheriting across an exec),
so I think avoid confusion with that. MADV_DONTFORK and MADV_DOFORK?
Accompanied by VM_DONTFORK?
> since the copy is only dont one write ...
"only done on write"?
> Index: linux-2.6.14-dontcopy/include/linux/mm.h
> ===================================================================
> --- linux-2.6.14-dontcopy.orig/include/linux/mm.h 2005-11-08 23:24:58.000000000 +0200
> +++ linux-2.6.14-dontcopy/include/linux/mm.h 2005-11-08 23:25:09.000000000 +0200
> @@ -154,6 +154,7 @@ extern unsigned int kobjsize(const void
> /* Used by sys_madvise() */
> #define VM_SEQ_READ 0x00008000 /* App will access data sequentially */
> #define VM_RAND_READ 0x00010000 /* App will not benefit from clustered reads */
> +#define VM_UDONTCOPY 0x02000000 /* App wants to set VM_DONTCOPY */
Please place it where you'd expect to find it by value.
> #define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */
> #define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */
> Index: linux-2.6.14-dontcopy/include/asm-x86_64/mman.h
> ===================================================================
> --- linux-2.6.14-dontcopy.orig/include/asm-x86_64/mman.h 2005-11-08 23:19:35.000000000 +0200
> +++ linux-2.6.14-dontcopy/include/asm-x86_64/mman.h 2005-11-08 23:19:46.000000000 +0200
> @@ -36,6 +36,8 @@
> #define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
> #define MADV_WILLNEED 0x3 /* pre-fault pages */
> #define MADV_DONTNEED 0x4 /* discard these pages */
> +#define MADV_DONTCOPY 0x30 /* dont inherit across fork */
> +#define MADV_DOCOPY 0x31 /* do inherit across fork */
>
> /* compatibility flags */
> #define MAP_ANON MAP_ANONYMOUS
I think that's probably a good idea, to choose a range away from the rest.
But I'm not quite sure: anyone familiar with adding APIs listening?
Hugh
next prev parent reply other threads:[~2005-11-10 13:11 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-01 19:30 Petr Vandrovec
2005-11-02 0:34 ` Nick Piggin
2005-11-02 1:17 ` Petr Vandrovec
2005-11-02 2:09 ` Nick Piggin
2005-11-02 12:26 ` Hugh Dickins
2005-11-02 18:06 ` Petr Vandrovec
2005-11-02 21:04 ` Benjamin Herrenschmidt
2005-11-02 21:41 ` Hugh Dickins
2005-11-02 21:45 ` Benjamin Herrenschmidt
2005-11-02 22:02 ` Hugh Dickins
2005-11-02 22:22 ` Benjamin Herrenschmidt
2005-11-03 8:03 ` Gleb Natapov
2005-11-03 13:32 ` Hugh Dickins
2005-11-03 13:55 ` Gleb Natapov
2005-11-03 21:21 ` Benjamin Herrenschmidt
2005-11-02 22:39 ` Petr Vandrovec
2005-11-03 8:12 ` Gleb Natapov
2005-11-03 14:11 ` Hugh Dickins
2005-11-03 14:22 ` Gleb Natapov
2005-11-03 14:37 ` Michael S. Tsirkin
2005-11-03 14:59 ` Hugh Dickins
2005-11-03 15:09 ` Gleb Natapov
2005-11-03 15:14 ` Michael S. Tsirkin
2005-11-03 15:37 ` Hugh Dickins
2005-11-03 15:53 ` Gleb Natapov
2005-11-03 15:56 ` Michael S. Tsirkin
2005-11-08 21:34 ` Michael S. Tsirkin
2005-11-10 12:35 ` Gleb Natapov
2005-11-10 12:48 ` Michael S. Tsirkin
2005-11-10 12:49 ` Gleb Natapov
2005-11-10 13:16 ` Michael S. Tsirkin
2005-11-10 13:16 ` Gleb Natapov
2005-11-10 13:21 ` Hugh Dickins
2005-11-10 13:26 ` Gleb Natapov
2005-11-10 13:15 ` Hugh Dickins
2005-11-10 13:10 ` Hugh Dickins [this message]
2005-11-10 13:37 ` Michael S. Tsirkin
2005-11-10 13:55 ` Hugh Dickins
2005-11-10 14:12 ` Michael S. Tsirkin
2005-11-14 12:25 ` Michael S. Tsirkin
2005-11-14 12:27 ` Gleb Natapov
2005-11-14 12:34 ` Michael S. Tsirkin
2005-11-14 12:40 ` Hugh Dickins
2005-11-14 14:57 ` Michael S. Tsirkin
2005-11-14 15:07 ` Gleb Natapov
2005-11-14 12:41 ` Gleb Natapov
2005-11-14 14:52 ` Michael S. Tsirkin
2005-11-14 15:00 ` Gleb Natapov
2005-11-14 20:23 ` Michael S. Tsirkin
2005-11-15 9:26 ` Gleb Natapov
2005-11-14 15:58 ` Hugh Dickins
2005-11-14 21:17 ` Michael S. Tsirkin
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=Pine.LNX.4.61.0511101251060.7127@goblin.wat.veritas.com \
--to=hugh@veritas.com \
--cc=benh@kernel.crashing.org \
--cc=gleb@minantech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@mellanox.co.il \
--cc=nickpiggin@yahoo.com.au \
--cc=pbadari@us.ibm.com \
--cc=vandrove@vc.cvut.cz \
/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
all inboxes | Powered by JetHome®