All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Add pseudo-anonymous huge page mappings V4
@ 2009-08-25 11:14 Eric B Munson
  2009-08-25 11:14 ` [PATCH 1/3] hugetlbfs: Allow the creation of files suitable for MAP_PRIVATE on the vfs internal mount Eric B Munson
  0 siblings, 1 reply; 62+ messages in thread
From: Eric B Munson @ 2009-08-25 11:14 UTC (permalink / raw)
  To: linux-kernel, linux-mm, akpm
  Cc: linux-man, mtk.manpages, randy.dunlap, Eric B Munson

This patch set adds a flag to mmap that allows the user to request
a mapping to be backed with huge pages.  This mapping will borrow
functionality from the huge page shm code to create a file on the
kernel internal mount and use it to approximate an anonymous mapping.
The MAP_HUGETLB flag is a modifier to MAP_ANONYMOUS and will not work
without both flags being preset.

A new flag is necessary because there is no other way to hook into
huge pages without creating a file on a hugetlbfs mount which
wouldn't be MAP_ANONYMOUS.

To userspace, this mapping will behave just like an anonymous mapping
because the file is not accessible outside of the kernel.

This patch set is meant to simplify the programming model, presently
there is a large chunk of boiler plate code, contained in libhugetlbfs,
required to create private, hugepage backed mappings.  This patch set
would allow use of hugepages without linking to libhugetlbfs or having
hugetblfs mounted.

Unification of the VM code would provide these same benefits, but it
has been resisted each time that it has been suggested for several
reasons: it would break PAGE_SIZE assumptions across the kernel, it
makes page-table abstractions really expensive, and it does not
provide any benefit on architectures that do not support huge pages,
incurring fast path penalties without providing any benefit on these
architectures.

Eric B Munson (3):
  hugetlbfs: Allow the creation of files suitable for MAP_PRIVATE on
    the vfs internal mount
  Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
  Add MAP_HUGETLB example

 Documentation/vm/00-INDEX         |    2 +
 Documentation/vm/hugetlbpage.txt  |   14 ++++---
 Documentation/vm/map_hugetlb.c    |   77 +++++++++++++++++++++++++++++++++++++
 fs/hugetlbfs/inode.c              |   21 ++++++++--
 include/asm-generic/mman-common.h |    1 +
 include/linux/hugetlb.h           |   19 ++++++++-
 ipc/shm.c                         |    2 +-
 mm/mmap.c                         |   19 +++++++++
 8 files changed, 142 insertions(+), 13 deletions(-)
 create mode 100644 Documentation/vm/map_hugetlb.c

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* [PATCH 1/3] hugetlbfs: Allow the creation of files suitable for MAP_PRIVATE on the vfs internal mount
  2009-08-25 11:14 [PATCH 0/3] Add pseudo-anonymous huge page mappings V4 Eric B Munson
@ 2009-08-25 11:14 ` Eric B Munson
  2009-08-25 11:14   ` [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions Eric B Munson
  2009-08-26 19:34     ` David Rientjes
  0 siblings, 2 replies; 62+ messages in thread
From: Eric B Munson @ 2009-08-25 11:14 UTC (permalink / raw)
  To: linux-kernel, linux-mm, akpm
  Cc: linux-man, mtk.manpages, randy.dunlap, Eric B Munson

There are two means of creating mappings backed by huge pages:

        1. mmap() a file created on hugetlbfs
        2. Use shm which creates a file on an internal mount which essentially
           maps it MAP_SHARED

The internal mount is only used for shared mappings but there is very
little that stops it being used for private mappings. This patch extends
hugetlbfs_file_setup() to deal with the creation of files that will be
mapped MAP_PRIVATE on the internal hugetlbfs mount. This extended API is
used in a subsequent patch to implement the MAP_HUGETLB mmap() flag.

Signed-off-by: Eric Munson <ebmunson@us.ibm.com>
---
 fs/hugetlbfs/inode.c    |   21 +++++++++++++++++----
 include/linux/hugetlb.h |   12 ++++++++++--
 ipc/shm.c               |    2 +-
 3 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index cb88dac..5584d55 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -506,6 +506,13 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, uid_t uid,
 		inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
 		INIT_LIST_HEAD(&inode->i_mapping->private_list);
 		info = HUGETLBFS_I(inode);
+		/*
+		 * The policy is initialized here even if we are creating a
+		 * private inode because initialization simply creates an
+		 * an empty rb tree and calls spin_lock_init(), later when we
+		 * call mpol_free_shared_policy() it will just return because
+		 * the rb tree will still be empty.
+		 */
 		mpol_shared_policy_init(&info->policy, NULL);
 		switch (mode & S_IFMT) {
 		default:
@@ -930,13 +937,19 @@ static struct file_system_type hugetlbfs_fs_type = {
 
 static struct vfsmount *hugetlbfs_vfsmount;
 
-static int can_do_hugetlb_shm(void)
+static int can_do_hugetlb_shm(int creat_flags)
 {
-	return capable(CAP_IPC_LOCK) || in_group_p(sysctl_hugetlb_shm_group);
+	if (creat_flags != HUGETLB_SHMFS_INODE)
+		return 0;
+	if (capable(CAP_IPC_LOCK))
+		return 1;
+	if (in_group_p(sysctl_hugetlb_shm_group))
+		return 1;
+	return 0;
 }
 
 struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag,
-						struct user_struct **user)
+				struct user_struct **user, int creat_flags)
 {
 	int error = -ENOMEM;
 	struct file *file;
@@ -948,7 +961,7 @@ struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag,
 	if (!hugetlbfs_vfsmount)
 		return ERR_PTR(-ENOENT);
 
-	if (!can_do_hugetlb_shm()) {
+	if (!can_do_hugetlb_shm(creat_flags)) {
 		*user = current_user();
 		if (user_shm_lock(size, *user)) {
 			WARN_ONCE(1,
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 5cbc620..38bb552 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -110,6 +110,14 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
 
 #endif /* !CONFIG_HUGETLB_PAGE */
 
+enum {
+	/*
+	 * The file will be used as an shm file so shmfs accounting rules
+	 * apply
+	 */
+	HUGETLB_SHMFS_INODE     = 1,
+};
+
 #ifdef CONFIG_HUGETLBFS
 struct hugetlbfs_config {
 	uid_t   uid;
@@ -148,7 +156,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
 extern const struct file_operations hugetlbfs_file_operations;
 extern struct vm_operations_struct hugetlb_vm_ops;
 struct file *hugetlb_file_setup(const char *name, size_t size, int acct,
-						struct user_struct **user);
+				struct user_struct **user, int creat_flags);
 int hugetlb_get_quota(struct address_space *mapping, long delta);
 void hugetlb_put_quota(struct address_space *mapping, long delta);
 
@@ -170,7 +178,7 @@ static inline void set_file_hugepages(struct file *file)
 
 #define is_file_hugepages(file)			0
 #define set_file_hugepages(file)		BUG()
-#define hugetlb_file_setup(name,size,acct,user)	ERR_PTR(-ENOSYS)
+#define hugetlb_file_setup(name,size,acct,user,creat)	ERR_PTR(-ENOSYS)
 
 #endif /* !CONFIG_HUGETLBFS */
 
diff --git a/ipc/shm.c b/ipc/shm.c
index 1bc4701..5ba4962 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -370,7 +370,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
 		if (shmflg & SHM_NORESERVE)
 			acctflag = VM_NORESERVE;
 		file = hugetlb_file_setup(name, size, acctflag,
-							&shp->mlock_user);
+					&shp->mlock_user, HUGETLB_SHMFS_INODE);
 	} else {
 		/*
 		 * Do not allow no accounting for OVERCOMMIT_NEVER, even
-- 
1.6.3.2

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

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
  2009-08-25 11:14 ` [PATCH 1/3] hugetlbfs: Allow the creation of files suitable for MAP_PRIVATE on the vfs internal mount Eric B Munson
@ 2009-08-25 11:14   ` Eric B Munson
  2009-08-25 11:14     ` [PATCH 3/3] Add MAP_HUGETLB example Eric B Munson
  2009-09-17 22:44       ` Andrew Morton
  2009-08-26 19:34     ` David Rientjes
  1 sibling, 2 replies; 62+ messages in thread
From: Eric B Munson @ 2009-08-25 11:14 UTC (permalink / raw)
  To: linux-kernel, linux-mm, akpm
  Cc: linux-man, mtk.manpages, randy.dunlap, Eric B Munson

This patch adds a flag for mmap that will be used to request a huge
page region that will look like anonymous memory to user space.  This
is accomplished by using a file on the internal vfsmount.  MAP_HUGETLB
is a modifier of MAP_ANONYMOUS and so must be specified with it.  The
region will behave the same as a MAP_ANONYMOUS region using small pages.

Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
---
 include/asm-generic/mman-common.h |    1 +
 include/linux/hugetlb.h           |    7 +++++++
 mm/mmap.c                         |   19 +++++++++++++++++++
 3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h
index 3b69ad3..12f5982 100644
--- a/include/asm-generic/mman-common.h
+++ b/include/asm-generic/mman-common.h
@@ -19,6 +19,7 @@
 #define MAP_TYPE	0x0f		/* Mask for type of mapping */
 #define MAP_FIXED	0x10		/* Interpret addr exactly */
 #define MAP_ANONYMOUS	0x20		/* don't use a file */
+#define MAP_HUGETLB	0x40		/* create a huge page mapping */
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_INVALIDATE	2		/* invalidate the caches */
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 38bb552..b0bc0fd 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -110,12 +110,19 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
 
 #endif /* !CONFIG_HUGETLB_PAGE */
 
+#define HUGETLB_ANON_FILE "anon_hugepage"
+
 enum {
 	/*
 	 * The file will be used as an shm file so shmfs accounting rules
 	 * apply
 	 */
 	HUGETLB_SHMFS_INODE     = 1,
+	/*
+	 * The file is being created on the internal vfs mount and shmfs
+	 * accounting rules do not apply
+	 */
+	HUGETLB_ANONHUGE_INODE  = 2,
 };
 
 #ifdef CONFIG_HUGETLBFS
diff --git a/mm/mmap.c b/mm/mmap.c
index 8101de4..9ca4f26 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -29,6 +29,7 @@
 #include <linux/rmap.h>
 #include <linux/mmu_notifier.h>
 #include <linux/perf_counter.h>
+#include <linux/hugetlb.h>
 
 #include <asm/uaccess.h>
 #include <asm/cacheflush.h>
@@ -951,6 +952,24 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
 	if (mm->map_count > sysctl_max_map_count)
 		return -ENOMEM;
 
+	if (flags & MAP_HUGETLB) {
+		struct user_struct *user = NULL;
+		if (file)
+			return -EINVAL;
+
+		/*
+		 * VM_NORESERVE is used because the reservations will be
+		 * taken when vm_ops->mmap() is called
+		 * A dummy user value is used because we are not locking
+		 * memory so no accounting is necessary
+		 */
+		len = ALIGN(len, huge_page_size(&default_hstate));
+		file = hugetlb_file_setup(HUGETLB_ANON_FILE, len, VM_NORESERVE,
+						&user, HUGETLB_ANONHUGE_INODE);
+		if (IS_ERR(file))
+			return PTR_ERR(file);
+	}
+
 	/* Obtain the address to map to. we verify (or select) it and ensure
 	 * that it represents a valid section of the address space.
 	 */
-- 
1.6.3.2

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

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH 3/3] Add MAP_HUGETLB example
  2009-08-25 11:14   ` [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions Eric B Munson
@ 2009-08-25 11:14     ` Eric B Munson
  2009-09-17 22:44       ` Andrew Morton
  1 sibling, 0 replies; 62+ messages in thread
From: Eric B Munson @ 2009-08-25 11:14 UTC (permalink / raw)
  To: linux-kernel, linux-mm, akpm
  Cc: linux-man, mtk.manpages, randy.dunlap, Eric B Munson

This patch adds an example of how to use the MAP_HUGETLB flag to the
vm documentation directory and a reference to the example in
hugetlbpage.txt.

Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
Acked-by: David Rientjes <rientjes@google.com>
---
 Documentation/vm/00-INDEX        |    2 +
 Documentation/vm/hugetlbpage.txt |   14 ++++---
 Documentation/vm/map_hugetlb.c   |   77 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 87 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/vm/map_hugetlb.c

diff --git a/Documentation/vm/00-INDEX b/Documentation/vm/00-INDEX
index 2f77ced..aabd973 100644
--- a/Documentation/vm/00-INDEX
+++ b/Documentation/vm/00-INDEX
@@ -20,3 +20,5 @@ slabinfo.c
 	- source code for a tool to get reports about slabs.
 slub.txt
 	- a short users guide for SLUB.
+map_hugetlb.c
+	- an example program that uses the MAP_HUGETLB mmap flag.
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
index ea8714f..6a8feab 100644
--- a/Documentation/vm/hugetlbpage.txt
+++ b/Documentation/vm/hugetlbpage.txt
@@ -146,12 +146,14 @@ Regular chown, chgrp, and chmod commands (with right permissions) could be
 used to change the file attributes on hugetlbfs.
 
 Also, it is important to note that no such mount command is required if the
-applications are going to use only shmat/shmget system calls.  Users who
-wish to use hugetlb page via shared memory segment should be a member of
-a supplementary group and system admin needs to configure that gid into
-/proc/sys/vm/hugetlb_shm_group.  It is possible for same or different
-applications to use any combination of mmaps and shm* calls, though the
-mount of filesystem will be required for using mmap calls.
+applications are going to use only shmat/shmget system calls or mmap with
+MAP_HUGETLB.  Users who wish to use hugetlb page via shared memory segment
+should be a member of a supplementary group and system admin needs to
+configure that gid into /proc/sys/vm/hugetlb_shm_group.  It is possible for
+same or different applications to use any combination of mmaps and shm*
+calls, though the mount of filesystem will be required for using mmap calls
+without MAP_HUGETLB.  For an example of how to use mmap with MAP_HUGETLB see
+map_hugetlb.c.
 
 *******************************************************************
 
diff --git a/Documentation/vm/map_hugetlb.c b/Documentation/vm/map_hugetlb.c
new file mode 100644
index 0000000..e2bdae3
--- /dev/null
+++ b/Documentation/vm/map_hugetlb.c
@@ -0,0 +1,77 @@
+/*
+ * Example of using hugepage memory in a user application using the mmap
+ * system call with MAP_HUGETLB flag.  Before running this program make
+ * sure the administrator has allocated enough default sized huge pages
+ * to cover the 256 MB allocation.
+ *
+ * For ia64 architecture, Linux kernel reserves Region number 4 for hugepages.
+ * That means the addresses starting with 0x800000... will need to be
+ * specified.  Specifying a fixed address is not required on ppc64, i386
+ * or x86_64.
+ */
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <fcntl.h>
+
+#define LENGTH (256UL*1024*1024)
+#define PROTECTION (PROT_READ | PROT_WRITE)
+
+#ifndef MAP_HUGETLB
+#define MAP_HUGETLB 0x40
+#endif
+
+/* Only ia64 requires this */
+#ifdef __ia64__
+#define ADDR (void *)(0x8000000000000000UL)
+#define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | MAP_FIXED)
+#else
+#define ADDR (void *)(0x0UL)
+#define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB)
+#endif
+
+void check_bytes(char *addr)
+{
+	printf("First hex is %x\n", *((unsigned int *)addr));
+}
+
+void write_bytes(char *addr)
+{
+	unsigned long i;
+
+	for (i = 0; i < LENGTH; i++)
+		*(addr + i) = (char)i;
+}
+
+void read_bytes(char *addr)
+{
+	unsigned long i;
+
+	check_bytes(addr);
+	for (i = 0; i < LENGTH; i++)
+		if (*(addr + i) != (char)i) {
+			printf("Mismatch at %lu\n", i);
+			break;
+		}
+}
+
+int main(void)
+{
+	void *addr;
+
+	addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, 0, 0);
+	if (addr == MAP_FAILED) {
+		perror("mmap");
+		exit(1);
+	}
+
+	printf("Returned address is %p\n", addr);
+	check_bytes(addr);
+	write_bytes(addr);
+	read_bytes(addr);
+
+	munmap(addr, LENGTH);
+
+	return 0;
+}
-- 
1.6.3.2

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

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* Re: [PATCH 1/3] hugetlbfs: Allow the creation of files suitable for MAP_PRIVATE on the vfs internal mount
  2009-08-25 11:14 ` [PATCH 1/3] hugetlbfs: Allow the creation of files suitable for MAP_PRIVATE on the vfs internal mount Eric B Munson
@ 2009-08-26 19:34     ` David Rientjes
  2009-08-26 19:34     ` David Rientjes
  1 sibling, 0 replies; 62+ messages in thread
From: David Rientjes @ 2009-08-26 19:34 UTC (permalink / raw)
  To: Eric B Munson
  Cc: linux-kernel, linux-mm, akpm, linux-man, mtk.manpages, randy.dunlap

On Tue, 25 Aug 2009, Eric B Munson wrote:

> There are two means of creating mappings backed by huge pages:
> 
>         1. mmap() a file created on hugetlbfs
>         2. Use shm which creates a file on an internal mount which essentially
>            maps it MAP_SHARED
> 
> The internal mount is only used for shared mappings but there is very
> little that stops it being used for private mappings. This patch extends
> hugetlbfs_file_setup() to deal with the creation of files that will be
> mapped MAP_PRIVATE on the internal hugetlbfs mount. This extended API is
> used in a subsequent patch to implement the MAP_HUGETLB mmap() flag.
> 
> Signed-off-by: Eric Munson <ebmunson@us.ibm.com>

Acked-by: David Rientjes <rientjes@google.com>

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 1/3] hugetlbfs: Allow the creation of files suitable for MAP_PRIVATE on the vfs internal mount
@ 2009-08-26 19:34     ` David Rientjes
  0 siblings, 0 replies; 62+ messages in thread
From: David Rientjes @ 2009-08-26 19:34 UTC (permalink / raw)
  To: Eric B Munson
  Cc: linux-kernel, linux-mm, akpm, linux-man, mtk.manpages, randy.dunlap

On Tue, 25 Aug 2009, Eric B Munson wrote:

> There are two means of creating mappings backed by huge pages:
> 
>         1. mmap() a file created on hugetlbfs
>         2. Use shm which creates a file on an internal mount which essentially
>            maps it MAP_SHARED
> 
> The internal mount is only used for shared mappings but there is very
> little that stops it being used for private mappings. This patch extends
> hugetlbfs_file_setup() to deal with the creation of files that will be
> mapped MAP_PRIVATE on the internal hugetlbfs mount. This extended API is
> used in a subsequent patch to implement the MAP_HUGETLB mmap() flag.
> 
> Signed-off-by: Eric Munson <ebmunson@us.ibm.com>

Acked-by: David Rientjes <rientjes@google.com>

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
  2009-08-25 11:14   ` [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions Eric B Munson
  2009-08-25 11:14     ` [PATCH 3/3] Add MAP_HUGETLB example Eric B Munson
@ 2009-09-17 22:44       ` Andrew Morton
  1 sibling, 0 replies; 62+ messages in thread
From: Andrew Morton @ 2009-09-17 22:44 UTC (permalink / raw)
  To: Eric B Munson
  Cc: linux-kernel, linux-mm, linux-man, mtk.manpages, randy.dunlap,
	ebmunson, Richard Henderson, Ivan Kokshaysky

On Tue, 25 Aug 2009 12:14:53 +0100
Eric B Munson <ebmunson@us.ibm.com> wrote:

> This patch adds a flag for mmap that will be used to request a huge
> page region that will look like anonymous memory to user space.  This
> is accomplished by using a file on the internal vfsmount.  MAP_HUGETLB
> is a modifier of MAP_ANONYMOUS and so must be specified with it.  The
> region will behave the same as a MAP_ANONYMOUS region using small pages.
> 
> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
> ---
>  include/asm-generic/mman-common.h |    1 +
>  include/linux/hugetlb.h           |    7 +++++++
>  mm/mmap.c                         |   19 +++++++++++++++++++

alpha fix:

From: Andrew Morton <akpm@linux-foundation.org>

mm/mmap.c: In function 'do_mmap_pgoff':
mm/mmap.c:953: error: 'MAP_HUGETLB' undeclared (first use in this function)
mm/mmap.c:953: error: (Each undeclared identifier is reported only once
mm/mmap.c:953: error: for each function it appears in.)

Cc: Adam Litke <agl@us.ibm.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: David Rientjes <rientjes@google.com>
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/alpha/include/asm/mman.h |    1 +
 1 file changed, 1 insertion(+)

diff -puN arch/alpha/include/asm/mman.h~hugetlb-add-map_hugetlb-for-mmaping-pseudo-anonymous-huge-page-regions-alpha-fix arch/alpha/include/asm/mman.h
--- a/arch/alpha/include/asm/mman.h~hugetlb-add-map_hugetlb-for-mmaping-pseudo-anonymous-huge-page-regions-alpha-fix
+++ a/arch/alpha/include/asm/mman.h
@@ -28,6 +28,7 @@
 #define MAP_NORESERVE	0x10000		/* don't check for reservations */
 #define MAP_POPULATE	0x20000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x40000		/* do not block on IO */
+#define MAP_HUGETLB	0x80000		/* create a huge page mapping */
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_SYNC		2		/* synchronous memory sync */
_


^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
@ 2009-09-17 22:44       ` Andrew Morton
  0 siblings, 0 replies; 62+ messages in thread
From: Andrew Morton @ 2009-09-17 22:44 UTC (permalink / raw)
  Cc: linux-kernel, linux-mm, linux-man, mtk.manpages, randy.dunlap,
	ebmunson, Richard Henderson, Ivan Kokshaysky

On Tue, 25 Aug 2009 12:14:53 +0100
Eric B Munson <ebmunson@us.ibm.com> wrote:

> This patch adds a flag for mmap that will be used to request a huge
> page region that will look like anonymous memory to user space.  This
> is accomplished by using a file on the internal vfsmount.  MAP_HUGETLB
> is a modifier of MAP_ANONYMOUS and so must be specified with it.  The
> region will behave the same as a MAP_ANONYMOUS region using small pages.
> 
> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
> ---
>  include/asm-generic/mman-common.h |    1 +
>  include/linux/hugetlb.h           |    7 +++++++
>  mm/mmap.c                         |   19 +++++++++++++++++++

alpha fix:

From: Andrew Morton <akpm@linux-foundation.org>

mm/mmap.c: In function 'do_mmap_pgoff':
mm/mmap.c:953: error: 'MAP_HUGETLB' undeclared (first use in this function)
mm/mmap.c:953: error: (Each undeclared identifier is reported only once
mm/mmap.c:953: error: for each function it appears in.)

Cc: Adam Litke <agl@us.ibm.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: David Rientjes <rientjes@google.com>
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/alpha/include/asm/mman.h |    1 +
 1 file changed, 1 insertion(+)

diff -puN arch/alpha/include/asm/mman.h~hugetlb-add-map_hugetlb-for-mmaping-pseudo-anonymous-huge-page-regions-alpha-fix arch/alpha/include/asm/mman.h
--- a/arch/alpha/include/asm/mman.h~hugetlb-add-map_hugetlb-for-mmaping-pseudo-anonymous-huge-page-regions-alpha-fix
+++ a/arch/alpha/include/asm/mman.h
@@ -28,6 +28,7 @@
 #define MAP_NORESERVE	0x10000		/* don't check for reservations */
 #define MAP_POPULATE	0x20000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x40000		/* do not block on IO */
+#define MAP_HUGETLB	0x80000		/* create a huge page mapping */
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_SYNC		2		/* synchronous memory sync */
_

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
@ 2009-09-17 22:44       ` Andrew Morton
  0 siblings, 0 replies; 62+ messages in thread
From: Andrew Morton @ 2009-09-17 22:44 UTC (permalink / raw)
  To: Eric B Munson
  Cc: linux-kernel, linux-mm, linux-man, mtk.manpages, randy.dunlap,
	Richard Henderson, Ivan Kokshaysky

On Tue, 25 Aug 2009 12:14:53 +0100
Eric B Munson <ebmunson@us.ibm.com> wrote:

> This patch adds a flag for mmap that will be used to request a huge
> page region that will look like anonymous memory to user space.  This
> is accomplished by using a file on the internal vfsmount.  MAP_HUGETLB
> is a modifier of MAP_ANONYMOUS and so must be specified with it.  The
> region will behave the same as a MAP_ANONYMOUS region using small pages.
> 
> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
> ---
>  include/asm-generic/mman-common.h |    1 +
>  include/linux/hugetlb.h           |    7 +++++++
>  mm/mmap.c                         |   19 +++++++++++++++++++

alpha fix:

From: Andrew Morton <akpm@linux-foundation.org>

mm/mmap.c: In function 'do_mmap_pgoff':
mm/mmap.c:953: error: 'MAP_HUGETLB' undeclared (first use in this function)
mm/mmap.c:953: error: (Each undeclared identifier is reported only once
mm/mmap.c:953: error: for each function it appears in.)

Cc: Adam Litke <agl@us.ibm.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: David Rientjes <rientjes@google.com>
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/alpha/include/asm/mman.h |    1 +
 1 file changed, 1 insertion(+)

diff -puN arch/alpha/include/asm/mman.h~hugetlb-add-map_hugetlb-for-mmaping-pseudo-anonymous-huge-page-regions-alpha-fix arch/alpha/include/asm/mman.h
--- a/arch/alpha/include/asm/mman.h~hugetlb-add-map_hugetlb-for-mmaping-pseudo-anonymous-huge-page-regions-alpha-fix
+++ a/arch/alpha/include/asm/mman.h
@@ -28,6 +28,7 @@
 #define MAP_NORESERVE	0x10000		/* don't check for reservations */
 #define MAP_POPULATE	0x20000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x40000		/* do not block on IO */
+#define MAP_HUGETLB	0x80000		/* create a huge page mapping */
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_SYNC		2		/* synchronous memory sync */
_

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
  2009-09-17 22:44       ` Andrew Morton
  (?)
@ 2009-09-18  0:46         ` Andrew Morton
  -1 siblings, 0 replies; 62+ messages in thread
From: Andrew Morton @ 2009-09-18  0:46 UTC (permalink / raw)
  To: ebmunson, linux-kernel, linux-mm, linux-man, mtk.manpages,
	randy.dunlap, rth, ink

On Thu, 17 Sep 2009 15:44:04 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> mm/mmap.c: In function 'do_mmap_pgoff':
> mm/mmap.c:953: error: 'MAP_HUGETLB' undeclared (first use in this function)

mips breaks as well.

I don't know how many other architectures broke.  I disabled the patches.

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
@ 2009-09-18  0:46         ` Andrew Morton
  0 siblings, 0 replies; 62+ messages in thread
From: Andrew Morton @ 2009-09-18  0:46 UTC (permalink / raw)
  To: ebmunson, linux-kernel, linux-mm, linux-man, mtk.manpages,
	randy.dunlap, rth, ink

On Thu, 17 Sep 2009 15:44:04 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> mm/mmap.c: In function 'do_mmap_pgoff':
> mm/mmap.c:953: error: 'MAP_HUGETLB' undeclared (first use in this function)

mips breaks as well.

I don't know how many other architectures broke.  I disabled the patches.

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
@ 2009-09-18  0:46         ` Andrew Morton
  0 siblings, 0 replies; 62+ messages in thread
From: Andrew Morton @ 2009-09-18  0:46 UTC (permalink / raw)
  To: ebmunson, linux-kernel, linux-mm, linux-man, mtk.manpages,
	randy.dunlap, rth, ink

On Thu, 17 Sep 2009 15:44:04 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> mm/mmap.c: In function 'do_mmap_pgoff':
> mm/mmap.c:953: error: 'MAP_HUGETLB' undeclared (first use in this function)

mips breaks as well.

I don't know how many other architectures broke.  I disabled the patches.

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* [PATCH] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
  2009-09-18  0:46         ` Andrew Morton
@ 2009-09-18 15:19           ` Arnd Bergmann
  -1 siblings, 0 replies; 62+ messages in thread
From: Arnd Bergmann @ 2009-09-18 15:19 UTC (permalink / raw)
  To: Andrew Morton
  Cc: ebmunson, linux-kernel, linux-mm, linux-man, mtk.manpages,
	randy.dunlap, rth, ink

This patch adds a flag for mmap that will be used to request a huge
page region that will look like anonymous memory to user space.  This
is accomplished by using a file on the internal vfsmount.  MAP_HUGETLB
is a modifier of MAP_ANONYMOUS and so must be specified with it.  The
region will behave the same as a MAP_ANONYMOUS region using small pages.

The patch also adds the MAP_STACK flag, which was previously defined
only on some architectures but not on others. Since MAP_STACK is meant
to be a hint only, architectures can define it without assigning a
specific meaning to it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org

---
On Friday 18 September 2009, Andrew Morton wrote:
> On Thu, 17 Sep 2009 15:44:04 -0700
> Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> > mm/mmap.c: In function 'do_mmap_pgoff':
> > mm/mmap.c:953: error: 'MAP_HUGETLB' undeclared (first use in this function)
> 
> mips breaks as well.
> 
> I don't know how many other architectures broke.  I disabled the patches.

two: parisc and xtensa.

It's also done in a different way from the existing flags, which makes
it more likely to break again if someone tries to add another flag.

This patch is more along the lines of how I explained it could be done,
adding the MAP_HUGETLB (and MAP_STACK) flags to the existing lists in
a consistent way.

A logical next step would be to replace the mman.h files that are basically
copies of include/asm-generic/mman.h.

	Arnd <><
---
 arch/alpha/include/asm/mman.h   |    2 ++
 arch/arm/include/asm/mman.h     |    2 ++
 arch/avr32/include/asm/mman.h   |    2 ++
 arch/cris/include/asm/mman.h    |    2 ++
 arch/frv/include/asm/mman.h     |    2 ++
 arch/h8300/include/asm/mman.h   |    2 ++
 arch/ia64/include/asm/mman.h    |    2 ++
 arch/m32r/include/asm/mman.h    |    2 ++
 arch/m68k/include/asm/mman.h    |    2 ++
 arch/mips/include/asm/mman.h    |    2 ++
 arch/mn10300/include/asm/mman.h |    2 ++
 arch/parisc/include/asm/mman.h  |    2 ++
 arch/powerpc/include/asm/mman.h |    2 ++
 arch/s390/include/asm/mman.h    |    2 ++
 arch/sparc/include/asm/mman.h   |    2 ++
 arch/x86/include/asm/mman.h     |    1 +
 arch/xtensa/include/asm/mman.h  |    2 ++
 include/asm-generic/mman.h      |    1 +
 18 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/arch/alpha/include/asm/mman.h b/arch/alpha/include/asm/mman.h
index 90d7c35..6e4d854 100644
--- a/arch/alpha/include/asm/mman.h
+++ b/arch/alpha/include/asm/mman.h
@@ -28,6 +28,8 @@
 #define MAP_NORESERVE	0x10000		/* don't check for reservations */
 #define MAP_POPULATE	0x20000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x40000		/* do not block on IO */
+#define MAP_STACK	0x80000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x100000	/* create a huge page mapping */
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_SYNC		2		/* synchronous memory sync */
diff --git a/arch/arm/include/asm/mman.h b/arch/arm/include/asm/mman.h
index fc26976..6464d47 100644
--- a/arch/arm/include/asm/mman.h
+++ b/arch/arm/include/asm/mman.h
@@ -10,6 +10,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) page tables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/avr32/include/asm/mman.h b/arch/avr32/include/asm/mman.h
index 9a92b15..38cea1b 100644
--- a/arch/avr32/include/asm/mman.h
+++ b/arch/avr32/include/asm/mman.h
@@ -10,6 +10,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) page tables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/cris/include/asm/mman.h b/arch/cris/include/asm/mman.h
index b7f0afb..de6b903 100644
--- a/arch/cris/include/asm/mman.h
+++ b/arch/cris/include/asm/mman.h
@@ -12,6 +12,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/frv/include/asm/mman.h b/arch/frv/include/asm/mman.h
index 58c1d11..1939343 100644
--- a/arch/frv/include/asm/mman.h
+++ b/arch/frv/include/asm/mman.h
@@ -10,6 +10,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/h8300/include/asm/mman.h b/arch/h8300/include/asm/mman.h
index cf35f0a..eacacd0 100644
--- a/arch/h8300/include/asm/mman.h
+++ b/arch/h8300/include/asm/mman.h
@@ -10,6 +10,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
index 48cf8b9..cf55884 100644
--- a/arch/ia64/include/asm/mman.h
+++ b/arch/ia64/include/asm/mman.h
@@ -18,6 +18,8 @@
 #define MAP_NORESERVE	0x04000		/* don't check for reservations */
 #define MAP_POPULATE	0x08000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/m32r/include/asm/mman.h b/arch/m32r/include/asm/mman.h
index 04a5f40..d191089 100644
--- a/arch/m32r/include/asm/mman.h
+++ b/arch/m32r/include/asm/mman.h
@@ -10,6 +10,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/m68k/include/asm/mman.h b/arch/m68k/include/asm/mman.h
index 9f5c4c4..c421fef 100644
--- a/arch/m68k/include/asm/mman.h
+++ b/arch/m68k/include/asm/mman.h
@@ -10,6 +10,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/mips/include/asm/mman.h b/arch/mips/include/asm/mman.h
index e4d6f1f..1578166 100644
--- a/arch/mips/include/asm/mman.h
+++ b/arch/mips/include/asm/mman.h
@@ -46,6 +46,8 @@
 #define MAP_LOCKED	0x8000		/* pages are locked */
 #define MAP_POPULATE	0x10000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x20000		/* do not block on IO */
+#define MAP_STACK	0x40000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x80000		/* create a huge page mapping */
 
 /*
  * Flags for msync
diff --git a/arch/mn10300/include/asm/mman.h b/arch/mn10300/include/asm/mman.h
index d04fac1..94611c3 100644
--- a/arch/mn10300/include/asm/mman.h
+++ b/arch/mn10300/include/asm/mman.h
@@ -21,6 +21,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/parisc/include/asm/mman.h b/arch/parisc/include/asm/mman.h
index defe752..ce4b265 100644
--- a/arch/parisc/include/asm/mman.h
+++ b/arch/parisc/include/asm/mman.h
@@ -22,6 +22,8 @@
 #define MAP_GROWSDOWN	0x8000		/* stack-like segment */
 #define MAP_POPULATE	0x10000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x20000		/* do not block on IO */
+#define MAP_STACK	0x40000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x80000		/* create a huge page mapping */
 
 #define MS_SYNC		1		/* synchronous memory sync */
 #define MS_ASYNC	2		/* sync memory asynchronously */
diff --git a/arch/powerpc/include/asm/mman.h b/arch/powerpc/include/asm/mman.h
index 7b1c498..d4a7f64 100644
--- a/arch/powerpc/include/asm/mman.h
+++ b/arch/powerpc/include/asm/mman.h
@@ -25,6 +25,8 @@
 
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #ifdef __KERNEL__
 #ifdef CONFIG_PPC64
diff --git a/arch/s390/include/asm/mman.h b/arch/s390/include/asm/mman.h
index f63fe7b..22714ca 100644
--- a/arch/s390/include/asm/mman.h
+++ b/arch/s390/include/asm/mman.h
@@ -18,6 +18,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/sparc/include/asm/mman.h b/arch/sparc/include/asm/mman.h
index 988192e..c3029ad 100644
--- a/arch/sparc/include/asm/mman.h
+++ b/arch/sparc/include/asm/mman.h
@@ -20,6 +20,8 @@
 
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
diff --git a/arch/x86/include/asm/mman.h b/arch/x86/include/asm/mman.h
index 751af25..c719f36 100644
--- a/arch/x86/include/asm/mman.h
+++ b/arch/x86/include/asm/mman.h
@@ -13,6 +13,7 @@
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
 #define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/xtensa/include/asm/mman.h b/arch/xtensa/include/asm/mman.h
index 9b92620..f380d04 100644
--- a/arch/xtensa/include/asm/mman.h
+++ b/arch/xtensa/include/asm/mman.h
@@ -53,6 +53,8 @@
 #define MAP_LOCKED	0x8000		/* pages are locked */
 #define MAP_POPULATE	0x10000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x20000		/* do not block on IO */
+#define MAP_STACK	0x40000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x80000		/* create a huge page mapping */
 
 /*
  * Flags for msync
diff --git a/include/asm-generic/mman.h b/include/asm-generic/mman.h
index 7cab4de..32c8bd6 100644
--- a/include/asm-generic/mman.h
+++ b/include/asm-generic/mman.h
@@ -11,6 +11,7 @@
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
 #define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
@ 2009-09-18 15:19           ` Arnd Bergmann
  0 siblings, 0 replies; 62+ messages in thread
From: Arnd Bergmann @ 2009-09-18 15:19 UTC (permalink / raw)
  To: Andrew Morton
  Cc: ebmunson, linux-kernel, linux-mm, linux-man, mtk.manpages,
	randy.dunlap, rth, ink

This patch adds a flag for mmap that will be used to request a huge
page region that will look like anonymous memory to user space.  This
is accomplished by using a file on the internal vfsmount.  MAP_HUGETLB
is a modifier of MAP_ANONYMOUS and so must be specified with it.  The
region will behave the same as a MAP_ANONYMOUS region using small pages.

The patch also adds the MAP_STACK flag, which was previously defined
only on some architectures but not on others. Since MAP_STACK is meant
to be a hint only, architectures can define it without assigning a
specific meaning to it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Eric B Munson <ebmunson@us.ibm.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org

---
On Friday 18 September 2009, Andrew Morton wrote:
> On Thu, 17 Sep 2009 15:44:04 -0700
> Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> > mm/mmap.c: In function 'do_mmap_pgoff':
> > mm/mmap.c:953: error: 'MAP_HUGETLB' undeclared (first use in this function)
> 
> mips breaks as well.
> 
> I don't know how many other architectures broke.  I disabled the patches.

two: parisc and xtensa.

It's also done in a different way from the existing flags, which makes
it more likely to break again if someone tries to add another flag.

This patch is more along the lines of how I explained it could be done,
adding the MAP_HUGETLB (and MAP_STACK) flags to the existing lists in
a consistent way.

A logical next step would be to replace the mman.h files that are basically
copies of include/asm-generic/mman.h.

	Arnd <><
---
 arch/alpha/include/asm/mman.h   |    2 ++
 arch/arm/include/asm/mman.h     |    2 ++
 arch/avr32/include/asm/mman.h   |    2 ++
 arch/cris/include/asm/mman.h    |    2 ++
 arch/frv/include/asm/mman.h     |    2 ++
 arch/h8300/include/asm/mman.h   |    2 ++
 arch/ia64/include/asm/mman.h    |    2 ++
 arch/m32r/include/asm/mman.h    |    2 ++
 arch/m68k/include/asm/mman.h    |    2 ++
 arch/mips/include/asm/mman.h    |    2 ++
 arch/mn10300/include/asm/mman.h |    2 ++
 arch/parisc/include/asm/mman.h  |    2 ++
 arch/powerpc/include/asm/mman.h |    2 ++
 arch/s390/include/asm/mman.h    |    2 ++
 arch/sparc/include/asm/mman.h   |    2 ++
 arch/x86/include/asm/mman.h     |    1 +
 arch/xtensa/include/asm/mman.h  |    2 ++
 include/asm-generic/mman.h      |    1 +
 18 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/arch/alpha/include/asm/mman.h b/arch/alpha/include/asm/mman.h
index 90d7c35..6e4d854 100644
--- a/arch/alpha/include/asm/mman.h
+++ b/arch/alpha/include/asm/mman.h
@@ -28,6 +28,8 @@
 #define MAP_NORESERVE	0x10000		/* don't check for reservations */
 #define MAP_POPULATE	0x20000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x40000		/* do not block on IO */
+#define MAP_STACK	0x80000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x100000	/* create a huge page mapping */
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_SYNC		2		/* synchronous memory sync */
diff --git a/arch/arm/include/asm/mman.h b/arch/arm/include/asm/mman.h
index fc26976..6464d47 100644
--- a/arch/arm/include/asm/mman.h
+++ b/arch/arm/include/asm/mman.h
@@ -10,6 +10,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) page tables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/avr32/include/asm/mman.h b/arch/avr32/include/asm/mman.h
index 9a92b15..38cea1b 100644
--- a/arch/avr32/include/asm/mman.h
+++ b/arch/avr32/include/asm/mman.h
@@ -10,6 +10,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) page tables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/cris/include/asm/mman.h b/arch/cris/include/asm/mman.h
index b7f0afb..de6b903 100644
--- a/arch/cris/include/asm/mman.h
+++ b/arch/cris/include/asm/mman.h
@@ -12,6 +12,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/frv/include/asm/mman.h b/arch/frv/include/asm/mman.h
index 58c1d11..1939343 100644
--- a/arch/frv/include/asm/mman.h
+++ b/arch/frv/include/asm/mman.h
@@ -10,6 +10,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/h8300/include/asm/mman.h b/arch/h8300/include/asm/mman.h
index cf35f0a..eacacd0 100644
--- a/arch/h8300/include/asm/mman.h
+++ b/arch/h8300/include/asm/mman.h
@@ -10,6 +10,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
index 48cf8b9..cf55884 100644
--- a/arch/ia64/include/asm/mman.h
+++ b/arch/ia64/include/asm/mman.h
@@ -18,6 +18,8 @@
 #define MAP_NORESERVE	0x04000		/* don't check for reservations */
 #define MAP_POPULATE	0x08000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/m32r/include/asm/mman.h b/arch/m32r/include/asm/mman.h
index 04a5f40..d191089 100644
--- a/arch/m32r/include/asm/mman.h
+++ b/arch/m32r/include/asm/mman.h
@@ -10,6 +10,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/m68k/include/asm/mman.h b/arch/m68k/include/asm/mman.h
index 9f5c4c4..c421fef 100644
--- a/arch/m68k/include/asm/mman.h
+++ b/arch/m68k/include/asm/mman.h
@@ -10,6 +10,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/mips/include/asm/mman.h b/arch/mips/include/asm/mman.h
index e4d6f1f..1578166 100644
--- a/arch/mips/include/asm/mman.h
+++ b/arch/mips/include/asm/mman.h
@@ -46,6 +46,8 @@
 #define MAP_LOCKED	0x8000		/* pages are locked */
 #define MAP_POPULATE	0x10000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x20000		/* do not block on IO */
+#define MAP_STACK	0x40000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x80000		/* create a huge page mapping */
 
 /*
  * Flags for msync
diff --git a/arch/mn10300/include/asm/mman.h b/arch/mn10300/include/asm/mman.h
index d04fac1..94611c3 100644
--- a/arch/mn10300/include/asm/mman.h
+++ b/arch/mn10300/include/asm/mman.h
@@ -21,6 +21,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/parisc/include/asm/mman.h b/arch/parisc/include/asm/mman.h
index defe752..ce4b265 100644
--- a/arch/parisc/include/asm/mman.h
+++ b/arch/parisc/include/asm/mman.h
@@ -22,6 +22,8 @@
 #define MAP_GROWSDOWN	0x8000		/* stack-like segment */
 #define MAP_POPULATE	0x10000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x20000		/* do not block on IO */
+#define MAP_STACK	0x40000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x80000		/* create a huge page mapping */
 
 #define MS_SYNC		1		/* synchronous memory sync */
 #define MS_ASYNC	2		/* sync memory asynchronously */
diff --git a/arch/powerpc/include/asm/mman.h b/arch/powerpc/include/asm/mman.h
index 7b1c498..d4a7f64 100644
--- a/arch/powerpc/include/asm/mman.h
+++ b/arch/powerpc/include/asm/mman.h
@@ -25,6 +25,8 @@
 
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #ifdef __KERNEL__
 #ifdef CONFIG_PPC64
diff --git a/arch/s390/include/asm/mman.h b/arch/s390/include/asm/mman.h
index f63fe7b..22714ca 100644
--- a/arch/s390/include/asm/mman.h
+++ b/arch/s390/include/asm/mman.h
@@ -18,6 +18,8 @@
 #define MAP_NORESERVE	0x4000		/* don't check for reservations */
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/sparc/include/asm/mman.h b/arch/sparc/include/asm/mman.h
index 988192e..c3029ad 100644
--- a/arch/sparc/include/asm/mman.h
+++ b/arch/sparc/include/asm/mman.h
@@ -20,6 +20,8 @@
 
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
+#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
diff --git a/arch/x86/include/asm/mman.h b/arch/x86/include/asm/mman.h
index 751af25..c719f36 100644
--- a/arch/x86/include/asm/mman.h
+++ b/arch/x86/include/asm/mman.h
@@ -13,6 +13,7 @@
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
 #define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */
diff --git a/arch/xtensa/include/asm/mman.h b/arch/xtensa/include/asm/mman.h
index 9b92620..f380d04 100644
--- a/arch/xtensa/include/asm/mman.h
+++ b/arch/xtensa/include/asm/mman.h
@@ -53,6 +53,8 @@
 #define MAP_LOCKED	0x8000		/* pages are locked */
 #define MAP_POPULATE	0x10000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x20000		/* do not block on IO */
+#define MAP_STACK	0x40000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x80000		/* create a huge page mapping */
 
 /*
  * Flags for msync
diff --git a/include/asm-generic/mman.h b/include/asm-generic/mman.h
index 7cab4de..32c8bd6 100644
--- a/include/asm-generic/mman.h
+++ b/include/asm-generic/mman.h
@@ -11,6 +11,7 @@
 #define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
 #define MAP_NONBLOCK	0x10000		/* do not block on IO */
 #define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
+#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
 
 #define MCL_CURRENT	1		/* lock all current mappings */
 #define MCL_FUTURE	2		/* lock all future mappings */

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

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH] remove duplicate asm/mman.h files
@ 2009-09-18 16:48             ` Arnd Bergmann
  0 siblings, 0 replies; 62+ messages in thread
From: Arnd Bergmann @ 2009-09-18 16:48 UTC (permalink / raw)
  To: Andrew Morton
  Cc: ebmunson, linux-kernel, linux-mm, linux-man, mtk.manpages,
	randy.dunlap, rth, ink

A number of architectures have identical asm/mman.h files,
x86 differs only in a single line, so they can all be merged
by using the new generic file.

The remaining asm/mman.h files are substantially different
from each other.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
On Friday 18 September 2009, Arnd Bergmann wrote:
> A logical next step would be to replace the mman.h files that are basically
> copies of include/asm-generic/mman.h.

We might as well do it now, since we're touching them anyway...
Patch applies on top of the previous one.

 arch/arm/include/asm/mman.h     |   20 +-------------------
 arch/avr32/include/asm/mman.h   |   20 +-------------------
 arch/cris/include/asm/mman.h    |   22 +---------------------
 arch/frv/include/asm/mman.h     |   21 +--------------------
 arch/h8300/include/asm/mman.h   |   20 +-------------------
 arch/ia64/include/asm/mman.h    |   16 ++--------------
 arch/m32r/include/asm/mman.h    |   20 +-------------------
 arch/m68k/include/asm/mman.h    |   20 +-------------------
 arch/mn10300/include/asm/mman.h |   31 +------------------------------
 arch/s390/include/asm/mman.h    |   15 +--------------
 arch/x86/include/asm/mman.h     |   15 +--------------
 11 files changed, 12 insertions(+), 208 deletions(-)

diff --git a/arch/arm/include/asm/mman.h b/arch/arm/include/asm/mman.h
index 6464d47..8eebf89 100644
--- a/arch/arm/include/asm/mman.h
+++ b/arch/arm/include/asm/mman.h
@@ -1,19 +1 @@
-#ifndef __ARM_MMAN_H__
-#define __ARM_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) page tables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __ARM_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/avr32/include/asm/mman.h b/arch/avr32/include/asm/mman.h
index 38cea1b..8eebf89 100644
--- a/arch/avr32/include/asm/mman.h
+++ b/arch/avr32/include/asm/mman.h
@@ -1,19 +1 @@
-#ifndef __ASM_AVR32_MMAN_H__
-#define __ASM_AVR32_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) page tables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __ASM_AVR32_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/cris/include/asm/mman.h b/arch/cris/include/asm/mman.h
index de6b903..8eebf89 100644
--- a/arch/cris/include/asm/mman.h
+++ b/arch/cris/include/asm/mman.h
@@ -1,21 +1 @@
-#ifndef __CRIS_MMAN_H__
-#define __CRIS_MMAN_H__
-
-/* verbatim copy of asm-i386/ version */
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __CRIS_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/frv/include/asm/mman.h b/arch/frv/include/asm/mman.h
index 1939343..8eebf89 100644
--- a/arch/frv/include/asm/mman.h
+++ b/arch/frv/include/asm/mman.h
@@ -1,20 +1 @@
-#ifndef __ASM_MMAN_H__
-#define __ASM_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __ASM_MMAN_H__ */
-
+#include <asm-generic/mman.h>
diff --git a/arch/h8300/include/asm/mman.h b/arch/h8300/include/asm/mman.h
index eacacd0..8eebf89 100644
--- a/arch/h8300/include/asm/mman.h
+++ b/arch/h8300/include/asm/mman.h
@@ -1,19 +1 @@
-#ifndef __H8300_MMAN_H__
-#define __H8300_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __H8300_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
index cf55884..4459028 100644
--- a/arch/ia64/include/asm/mman.h
+++ b/arch/ia64/include/asm/mman.h
@@ -8,21 +8,9 @@
  *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
-#include <asm-generic/mman-common.h>
+#include <asm-generic/mman.h>
 
-#define MAP_GROWSDOWN	0x00100		/* stack-like segment */
-#define MAP_GROWSUP	0x00200		/* register stack-like segment */
-#define MAP_DENYWRITE	0x00800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x01000		/* mark it as an executable */
-#define MAP_LOCKED	0x02000		/* pages are locked */
-#define MAP_NORESERVE	0x04000		/* don't check for reservations */
-#define MAP_POPULATE	0x08000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
+#define MAP_GROWSUP	0x0200		/* register stack-like segment */
 
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
diff --git a/arch/m32r/include/asm/mman.h b/arch/m32r/include/asm/mman.h
index d191089..8eebf89 100644
--- a/arch/m32r/include/asm/mman.h
+++ b/arch/m32r/include/asm/mman.h
@@ -1,19 +1 @@
-#ifndef __M32R_MMAN_H__
-#define __M32R_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __M32R_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/m68k/include/asm/mman.h b/arch/m68k/include/asm/mman.h
index c421fef..8eebf89 100644
--- a/arch/m68k/include/asm/mman.h
+++ b/arch/m68k/include/asm/mman.h
@@ -1,19 +1 @@
-#ifndef __M68K_MMAN_H__
-#define __M68K_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __M68K_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/mn10300/include/asm/mman.h b/arch/mn10300/include/asm/mman.h
index 94611c3..8eebf89 100644
--- a/arch/mn10300/include/asm/mman.h
+++ b/arch/mn10300/include/asm/mman.h
@@ -1,30 +1 @@
-/* MN10300 Constants for mmap and co.
- *
- * Copyright (C) 2007 Matsushita Electric Industrial Co., Ltd.
- * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
- * - Derived from asm-x86/mman.h
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public Licence
- * as published by the Free Software Foundation; either version
- * 2 of the Licence, or (at your option) any later version.
- */
-#ifndef _ASM_MMAN_H
-#define _ASM_MMAN_H
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* _ASM_MMAN_H */
+#include <asm-generic/mman.h>
diff --git a/arch/s390/include/asm/mman.h b/arch/s390/include/asm/mman.h
index 22714ca..4e9c8ae 100644
--- a/arch/s390/include/asm/mman.h
+++ b/arch/s390/include/asm/mman.h
@@ -9,20 +9,7 @@
 #ifndef __S390_MMAN_H__
 #define __S390_MMAN_H__
 
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
+#include <asm-generic/mman.h>
 
 #if defined(__KERNEL__) && !defined(__ASSEMBLY__) && defined(CONFIG_64BIT)
 int s390_mmap_check(unsigned long addr, unsigned long len);
diff --git a/arch/x86/include/asm/mman.h b/arch/x86/include/asm/mman.h
index c719f36..c582add 100644
--- a/arch/x86/include/asm/mman.h
+++ b/arch/x86/include/asm/mman.h
@@ -1,21 +1,8 @@
 #ifndef _ASM_X86_MMAN_H
 #define _ASM_X86_MMAN_H
 
-#include <asm-generic/mman-common.h>
+#include <asm-generic/mman.h>
 
 #define MAP_32BIT	0x40		/* only give out 32bit addresses */
 
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
 #endif /* _ASM_X86_MMAN_H */
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH] remove duplicate asm/mman.h files
@ 2009-09-18 16:48             ` Arnd Bergmann
  0 siblings, 0 replies; 62+ messages in thread
From: Arnd Bergmann @ 2009-09-18 16:48 UTC (permalink / raw)
  To: Andrew Morton
  Cc: ebmunson-r/Jw6+rmf7HQT0dZR+AlfA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
	linux-man-u79uwXL29TY76Z2rM5mHXA,
	mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA, rth-hL46jP5Bxq7R7s880joybQ,
	ink-biIs/Y0ymYJMZLIVYojuPNP0rXTJTi09

A number of architectures have identical asm/mman.h files,
x86 differs only in a single line, so they can all be merged
by using the new generic file.

The remaining asm/mman.h files are substantially different
from each other.

Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
---
On Friday 18 September 2009, Arnd Bergmann wrote:
> A logical next step would be to replace the mman.h files that are basically
> copies of include/asm-generic/mman.h.

We might as well do it now, since we're touching them anyway...
Patch applies on top of the previous one.

 arch/arm/include/asm/mman.h     |   20 +-------------------
 arch/avr32/include/asm/mman.h   |   20 +-------------------
 arch/cris/include/asm/mman.h    |   22 +---------------------
 arch/frv/include/asm/mman.h     |   21 +--------------------
 arch/h8300/include/asm/mman.h   |   20 +-------------------
 arch/ia64/include/asm/mman.h    |   16 ++--------------
 arch/m32r/include/asm/mman.h    |   20 +-------------------
 arch/m68k/include/asm/mman.h    |   20 +-------------------
 arch/mn10300/include/asm/mman.h |   31 +------------------------------
 arch/s390/include/asm/mman.h    |   15 +--------------
 arch/x86/include/asm/mman.h     |   15 +--------------
 11 files changed, 12 insertions(+), 208 deletions(-)

diff --git a/arch/arm/include/asm/mman.h b/arch/arm/include/asm/mman.h
index 6464d47..8eebf89 100644
--- a/arch/arm/include/asm/mman.h
+++ b/arch/arm/include/asm/mman.h
@@ -1,19 +1 @@
-#ifndef __ARM_MMAN_H__
-#define __ARM_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) page tables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __ARM_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/avr32/include/asm/mman.h b/arch/avr32/include/asm/mman.h
index 38cea1b..8eebf89 100644
--- a/arch/avr32/include/asm/mman.h
+++ b/arch/avr32/include/asm/mman.h
@@ -1,19 +1 @@
-#ifndef __ASM_AVR32_MMAN_H__
-#define __ASM_AVR32_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) page tables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __ASM_AVR32_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/cris/include/asm/mman.h b/arch/cris/include/asm/mman.h
index de6b903..8eebf89 100644
--- a/arch/cris/include/asm/mman.h
+++ b/arch/cris/include/asm/mman.h
@@ -1,21 +1 @@
-#ifndef __CRIS_MMAN_H__
-#define __CRIS_MMAN_H__
-
-/* verbatim copy of asm-i386/ version */
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __CRIS_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/frv/include/asm/mman.h b/arch/frv/include/asm/mman.h
index 1939343..8eebf89 100644
--- a/arch/frv/include/asm/mman.h
+++ b/arch/frv/include/asm/mman.h
@@ -1,20 +1 @@
-#ifndef __ASM_MMAN_H__
-#define __ASM_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __ASM_MMAN_H__ */
-
+#include <asm-generic/mman.h>
diff --git a/arch/h8300/include/asm/mman.h b/arch/h8300/include/asm/mman.h
index eacacd0..8eebf89 100644
--- a/arch/h8300/include/asm/mman.h
+++ b/arch/h8300/include/asm/mman.h
@@ -1,19 +1 @@
-#ifndef __H8300_MMAN_H__
-#define __H8300_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __H8300_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
index cf55884..4459028 100644
--- a/arch/ia64/include/asm/mman.h
+++ b/arch/ia64/include/asm/mman.h
@@ -8,21 +8,9 @@
  *	David Mosberger-Tang <davidm-sDzT885Ts8HQT0dZR+AlfA@public.gmane.org>, Hewlett-Packard Co
  */
 
-#include <asm-generic/mman-common.h>
+#include <asm-generic/mman.h>
 
-#define MAP_GROWSDOWN	0x00100		/* stack-like segment */
-#define MAP_GROWSUP	0x00200		/* register stack-like segment */
-#define MAP_DENYWRITE	0x00800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x01000		/* mark it as an executable */
-#define MAP_LOCKED	0x02000		/* pages are locked */
-#define MAP_NORESERVE	0x04000		/* don't check for reservations */
-#define MAP_POPULATE	0x08000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
+#define MAP_GROWSUP	0x0200		/* register stack-like segment */
 
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
diff --git a/arch/m32r/include/asm/mman.h b/arch/m32r/include/asm/mman.h
index d191089..8eebf89 100644
--- a/arch/m32r/include/asm/mman.h
+++ b/arch/m32r/include/asm/mman.h
@@ -1,19 +1 @@
-#ifndef __M32R_MMAN_H__
-#define __M32R_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __M32R_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/m68k/include/asm/mman.h b/arch/m68k/include/asm/mman.h
index c421fef..8eebf89 100644
--- a/arch/m68k/include/asm/mman.h
+++ b/arch/m68k/include/asm/mman.h
@@ -1,19 +1 @@
-#ifndef __M68K_MMAN_H__
-#define __M68K_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __M68K_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/mn10300/include/asm/mman.h b/arch/mn10300/include/asm/mman.h
index 94611c3..8eebf89 100644
--- a/arch/mn10300/include/asm/mman.h
+++ b/arch/mn10300/include/asm/mman.h
@@ -1,30 +1 @@
-/* MN10300 Constants for mmap and co.
- *
- * Copyright (C) 2007 Matsushita Electric Industrial Co., Ltd.
- * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
- * - Derived from asm-x86/mman.h
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public Licence
- * as published by the Free Software Foundation; either version
- * 2 of the Licence, or (at your option) any later version.
- */
-#ifndef _ASM_MMAN_H
-#define _ASM_MMAN_H
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* _ASM_MMAN_H */
+#include <asm-generic/mman.h>
diff --git a/arch/s390/include/asm/mman.h b/arch/s390/include/asm/mman.h
index 22714ca..4e9c8ae 100644
--- a/arch/s390/include/asm/mman.h
+++ b/arch/s390/include/asm/mman.h
@@ -9,20 +9,7 @@
 #ifndef __S390_MMAN_H__
 #define __S390_MMAN_H__
 
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
+#include <asm-generic/mman.h>
 
 #if defined(__KERNEL__) && !defined(__ASSEMBLY__) && defined(CONFIG_64BIT)
 int s390_mmap_check(unsigned long addr, unsigned long len);
diff --git a/arch/x86/include/asm/mman.h b/arch/x86/include/asm/mman.h
index c719f36..c582add 100644
--- a/arch/x86/include/asm/mman.h
+++ b/arch/x86/include/asm/mman.h
@@ -1,21 +1,8 @@
 #ifndef _ASM_X86_MMAN_H
 #define _ASM_X86_MMAN_H
 
-#include <asm-generic/mman-common.h>
+#include <asm-generic/mman.h>
 
 #define MAP_32BIT	0x40		/* only give out 32bit addresses */
 
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* [PATCH] remove duplicate asm/mman.h files
@ 2009-09-18 16:48             ` Arnd Bergmann
  0 siblings, 0 replies; 62+ messages in thread
From: Arnd Bergmann @ 2009-09-18 16:48 UTC (permalink / raw)
  To: Andrew Morton
  Cc: ebmunson, linux-kernel, linux-mm, linux-man, mtk.manpages,
	randy.dunlap, rth, ink

A number of architectures have identical asm/mman.h files,
x86 differs only in a single line, so they can all be merged
by using the new generic file.

The remaining asm/mman.h files are substantially different
from each other.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
On Friday 18 September 2009, Arnd Bergmann wrote:
> A logical next step would be to replace the mman.h files that are basically
> copies of include/asm-generic/mman.h.

We might as well do it now, since we're touching them anyway...
Patch applies on top of the previous one.

 arch/arm/include/asm/mman.h     |   20 +-------------------
 arch/avr32/include/asm/mman.h   |   20 +-------------------
 arch/cris/include/asm/mman.h    |   22 +---------------------
 arch/frv/include/asm/mman.h     |   21 +--------------------
 arch/h8300/include/asm/mman.h   |   20 +-------------------
 arch/ia64/include/asm/mman.h    |   16 ++--------------
 arch/m32r/include/asm/mman.h    |   20 +-------------------
 arch/m68k/include/asm/mman.h    |   20 +-------------------
 arch/mn10300/include/asm/mman.h |   31 +------------------------------
 arch/s390/include/asm/mman.h    |   15 +--------------
 arch/x86/include/asm/mman.h     |   15 +--------------
 11 files changed, 12 insertions(+), 208 deletions(-)

diff --git a/arch/arm/include/asm/mman.h b/arch/arm/include/asm/mman.h
index 6464d47..8eebf89 100644
--- a/arch/arm/include/asm/mman.h
+++ b/arch/arm/include/asm/mman.h
@@ -1,19 +1 @@
-#ifndef __ARM_MMAN_H__
-#define __ARM_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) page tables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __ARM_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/avr32/include/asm/mman.h b/arch/avr32/include/asm/mman.h
index 38cea1b..8eebf89 100644
--- a/arch/avr32/include/asm/mman.h
+++ b/arch/avr32/include/asm/mman.h
@@ -1,19 +1 @@
-#ifndef __ASM_AVR32_MMAN_H__
-#define __ASM_AVR32_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) page tables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __ASM_AVR32_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/cris/include/asm/mman.h b/arch/cris/include/asm/mman.h
index de6b903..8eebf89 100644
--- a/arch/cris/include/asm/mman.h
+++ b/arch/cris/include/asm/mman.h
@@ -1,21 +1 @@
-#ifndef __CRIS_MMAN_H__
-#define __CRIS_MMAN_H__
-
-/* verbatim copy of asm-i386/ version */
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __CRIS_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/frv/include/asm/mman.h b/arch/frv/include/asm/mman.h
index 1939343..8eebf89 100644
--- a/arch/frv/include/asm/mman.h
+++ b/arch/frv/include/asm/mman.h
@@ -1,20 +1 @@
-#ifndef __ASM_MMAN_H__
-#define __ASM_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __ASM_MMAN_H__ */
-
+#include <asm-generic/mman.h>
diff --git a/arch/h8300/include/asm/mman.h b/arch/h8300/include/asm/mman.h
index eacacd0..8eebf89 100644
--- a/arch/h8300/include/asm/mman.h
+++ b/arch/h8300/include/asm/mman.h
@@ -1,19 +1 @@
-#ifndef __H8300_MMAN_H__
-#define __H8300_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __H8300_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
index cf55884..4459028 100644
--- a/arch/ia64/include/asm/mman.h
+++ b/arch/ia64/include/asm/mman.h
@@ -8,21 +8,9 @@
  *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
  */
 
-#include <asm-generic/mman-common.h>
+#include <asm-generic/mman.h>
 
-#define MAP_GROWSDOWN	0x00100		/* stack-like segment */
-#define MAP_GROWSUP	0x00200		/* register stack-like segment */
-#define MAP_DENYWRITE	0x00800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x01000		/* mark it as an executable */
-#define MAP_LOCKED	0x02000		/* pages are locked */
-#define MAP_NORESERVE	0x04000		/* don't check for reservations */
-#define MAP_POPULATE	0x08000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
+#define MAP_GROWSUP	0x0200		/* register stack-like segment */
 
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
diff --git a/arch/m32r/include/asm/mman.h b/arch/m32r/include/asm/mman.h
index d191089..8eebf89 100644
--- a/arch/m32r/include/asm/mman.h
+++ b/arch/m32r/include/asm/mman.h
@@ -1,19 +1 @@
-#ifndef __M32R_MMAN_H__
-#define __M32R_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __M32R_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/m68k/include/asm/mman.h b/arch/m68k/include/asm/mman.h
index c421fef..8eebf89 100644
--- a/arch/m68k/include/asm/mman.h
+++ b/arch/m68k/include/asm/mman.h
@@ -1,19 +1 @@
-#ifndef __M68K_MMAN_H__
-#define __M68K_MMAN_H__
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* __M68K_MMAN_H__ */
+#include <asm-generic/mman.h>
diff --git a/arch/mn10300/include/asm/mman.h b/arch/mn10300/include/asm/mman.h
index 94611c3..8eebf89 100644
--- a/arch/mn10300/include/asm/mman.h
+++ b/arch/mn10300/include/asm/mman.h
@@ -1,30 +1 @@
-/* MN10300 Constants for mmap and co.
- *
- * Copyright (C) 2007 Matsushita Electric Industrial Co., Ltd.
- * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
- * - Derived from asm-x86/mman.h
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public Licence
- * as published by the Free Software Foundation; either version
- * 2 of the Licence, or (at your option) any later version.
- */
-#ifndef _ASM_MMAN_H
-#define _ASM_MMAN_H
-
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
-#endif /* _ASM_MMAN_H */
+#include <asm-generic/mman.h>
diff --git a/arch/s390/include/asm/mman.h b/arch/s390/include/asm/mman.h
index 22714ca..4e9c8ae 100644
--- a/arch/s390/include/asm/mman.h
+++ b/arch/s390/include/asm/mman.h
@@ -9,20 +9,7 @@
 #ifndef __S390_MMAN_H__
 #define __S390_MMAN_H__
 
-#include <asm-generic/mman-common.h>
-
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
+#include <asm-generic/mman.h>
 
 #if defined(__KERNEL__) && !defined(__ASSEMBLY__) && defined(CONFIG_64BIT)
 int s390_mmap_check(unsigned long addr, unsigned long len);
diff --git a/arch/x86/include/asm/mman.h b/arch/x86/include/asm/mman.h
index c719f36..c582add 100644
--- a/arch/x86/include/asm/mman.h
+++ b/arch/x86/include/asm/mman.h
@@ -1,21 +1,8 @@
 #ifndef _ASM_X86_MMAN_H
 #define _ASM_X86_MMAN_H
 
-#include <asm-generic/mman-common.h>
+#include <asm-generic/mman.h>
 
 #define MAP_32BIT	0x40		/* only give out 32bit addresses */
 
-#define MAP_GROWSDOWN	0x0100		/* stack-like segment */
-#define MAP_DENYWRITE	0x0800		/* ETXTBSY */
-#define MAP_EXECUTABLE	0x1000		/* mark it as an executable */
-#define MAP_LOCKED	0x2000		/* pages are locked */
-#define MAP_NORESERVE	0x4000		/* don't check for reservations */
-#define MAP_POPULATE	0x8000		/* populate (prefault) pagetables */
-#define MAP_NONBLOCK	0x10000		/* do not block on IO */
-#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
-#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
-
-#define MCL_CURRENT	1		/* lock all current mappings */
-#define MCL_FUTURE	2		/* lock all future mappings */
-
 #endif /* _ASM_X86_MMAN_H */
-- 
1.6.3.3

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

^ permalink raw reply related	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-18 19:37               ` David Rientjes
  0 siblings, 0 replies; 62+ messages in thread
From: David Rientjes @ 2009-09-18 19:37 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andrew Morton, ebmunson, linux-kernel, linux-mm, linux-man,
	mtk.manpages, randy.dunlap, rth, ink

On Fri, 18 Sep 2009, Arnd Bergmann wrote:

> diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
> index cf55884..4459028 100644
> --- a/arch/ia64/include/asm/mman.h
> +++ b/arch/ia64/include/asm/mman.h
> @@ -8,21 +8,9 @@
>   *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
>   */
>  
> -#include <asm-generic/mman-common.h>
> +#include <asm-generic/mman.h>
>  
> -#define MAP_GROWSDOWN	0x00100		/* stack-like segment */
> -#define MAP_GROWSUP	0x00200		/* register stack-like segment */
> -#define MAP_DENYWRITE	0x00800		/* ETXTBSY */
> -#define MAP_EXECUTABLE	0x01000		/* mark it as an executable */
> -#define MAP_LOCKED	0x02000		/* pages are locked */
> -#define MAP_NORESERVE	0x04000		/* don't check for reservations */
> -#define MAP_POPULATE	0x08000		/* populate (prefault) pagetables */
> -#define MAP_NONBLOCK	0x10000		/* do not block on IO */
> -#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
> -#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
> -
> -#define MCL_CURRENT	1		/* lock all current mappings */
> -#define MCL_FUTURE	2		/* lock all future mappings */
> +#define MAP_GROWSUP	0x0200		/* register stack-like segment */
>  
>  #ifdef __KERNEL__
>  #ifndef __ASSEMBLY__

ia64 doesn't use MAP_GROWSUP, so it's probably not necessary to carry it 
along with your cleanup.

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-18 19:37               ` David Rientjes
  0 siblings, 0 replies; 62+ messages in thread
From: David Rientjes @ 2009-09-18 19:37 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andrew Morton, ebmunson-r/Jw6+rmf7HQT0dZR+AlfA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
	linux-man-u79uwXL29TY76Z2rM5mHXA,
	mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA, rth-hL46jP5Bxq7R7s880joybQ,
	ink-biIs/Y0ymYJMZLIVYojuPNP0rXTJTi09

On Fri, 18 Sep 2009, Arnd Bergmann wrote:

> diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
> index cf55884..4459028 100644
> --- a/arch/ia64/include/asm/mman.h
> +++ b/arch/ia64/include/asm/mman.h
> @@ -8,21 +8,9 @@
>   *	David Mosberger-Tang <davidm-sDzT885Ts8HQT0dZR+AlfA@public.gmane.org>, Hewlett-Packard Co
>   */
>  
> -#include <asm-generic/mman-common.h>
> +#include <asm-generic/mman.h>
>  
> -#define MAP_GROWSDOWN	0x00100		/* stack-like segment */
> -#define MAP_GROWSUP	0x00200		/* register stack-like segment */
> -#define MAP_DENYWRITE	0x00800		/* ETXTBSY */
> -#define MAP_EXECUTABLE	0x01000		/* mark it as an executable */
> -#define MAP_LOCKED	0x02000		/* pages are locked */
> -#define MAP_NORESERVE	0x04000		/* don't check for reservations */
> -#define MAP_POPULATE	0x08000		/* populate (prefault) pagetables */
> -#define MAP_NONBLOCK	0x10000		/* do not block on IO */
> -#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
> -#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
> -
> -#define MCL_CURRENT	1		/* lock all current mappings */
> -#define MCL_FUTURE	2		/* lock all future mappings */
> +#define MAP_GROWSUP	0x0200		/* register stack-like segment */
>  
>  #ifdef __KERNEL__
>  #ifndef __ASSEMBLY__

ia64 doesn't use MAP_GROWSUP, so it's probably not necessary to carry it 
along with your cleanup.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-18 19:37               ` David Rientjes
  0 siblings, 0 replies; 62+ messages in thread
From: David Rientjes @ 2009-09-18 19:37 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andrew Morton, ebmunson, linux-kernel, linux-mm, linux-man,
	mtk.manpages, randy.dunlap, rth, ink

On Fri, 18 Sep 2009, Arnd Bergmann wrote:

> diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
> index cf55884..4459028 100644
> --- a/arch/ia64/include/asm/mman.h
> +++ b/arch/ia64/include/asm/mman.h
> @@ -8,21 +8,9 @@
>   *	David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
>   */
>  
> -#include <asm-generic/mman-common.h>
> +#include <asm-generic/mman.h>
>  
> -#define MAP_GROWSDOWN	0x00100		/* stack-like segment */
> -#define MAP_GROWSUP	0x00200		/* register stack-like segment */
> -#define MAP_DENYWRITE	0x00800		/* ETXTBSY */
> -#define MAP_EXECUTABLE	0x01000		/* mark it as an executable */
> -#define MAP_LOCKED	0x02000		/* pages are locked */
> -#define MAP_NORESERVE	0x04000		/* don't check for reservations */
> -#define MAP_POPULATE	0x08000		/* populate (prefault) pagetables */
> -#define MAP_NONBLOCK	0x10000		/* do not block on IO */
> -#define MAP_STACK	0x20000		/* give out an address that is best suited for process/thread stacks */
> -#define MAP_HUGETLB	0x40000		/* create a huge page mapping */
> -
> -#define MCL_CURRENT	1		/* lock all current mappings */
> -#define MCL_FUTURE	2		/* lock all future mappings */
> +#define MAP_GROWSUP	0x0200		/* register stack-like segment */
>  
>  #ifdef __KERNEL__
>  #ifndef __ASSEMBLY__

ia64 doesn't use MAP_GROWSUP, so it's probably not necessary to carry it 
along with your cleanup.

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
  2009-09-18 19:37               ` David Rientjes
  (?)
@ 2009-09-21  8:31                 ` Arnd Bergmann
  -1 siblings, 0 replies; 62+ messages in thread
From: Arnd Bergmann @ 2009-09-21  8:31 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, ebmunson, linux-kernel, linux-mm, linux-man,
	mtk.manpages, randy.dunlap, rth, ink, Tony Luck, Fenghua Yu,
	linux-ia64

On Friday 18 September 2009, David Rientjes wrote:
> On Fri, 18 Sep 2009, Arnd Bergmann wrote:
>
> > -#define MCL_CURRENT	1		/* lock all current mappings */
> > -#define MCL_FUTURE	2		/* lock all future mappings */
> > +#define MAP_GROWSUP	0x0200		/* register stack-like segment */
> >  
> >  #ifdef __KERNEL__
> >  #ifndef __ASSEMBLY__
> 
> ia64 doesn't use MAP_GROWSUP, so it's probably not necessary to carry it 
> along with your cleanup.

ia64 is the only architecture defining it, nobody uses it in the kernel.
If the ia64 maintainers want to remove it in a separate patch, that
would probably be a good idea.

I tried not to change the ABI in any way in my patch, and there is
a theoretical possibility that some user space program on ia64 currently
depends on that definition.

	Arnd <><

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21  8:31                 ` Arnd Bergmann
  0 siblings, 0 replies; 62+ messages in thread
From: Arnd Bergmann @ 2009-09-21  8:31 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, ebmunson, linux-kernel, linux-mm, linux-man,
	mtk.manpages, randy.dunlap, rth, ink, Tony Luck, Fenghua Yu,
	linux-ia64

On Friday 18 September 2009, David Rientjes wrote:
> On Fri, 18 Sep 2009, Arnd Bergmann wrote:
>
> > -#define MCL_CURRENT	1		/* lock all current mappings */
> > -#define MCL_FUTURE	2		/* lock all future mappings */
> > +#define MAP_GROWSUP	0x0200		/* register stack-like segment */
> >  
> >  #ifdef __KERNEL__
> >  #ifndef __ASSEMBLY__
> 
> ia64 doesn't use MAP_GROWSUP, so it's probably not necessary to carry it 
> along with your cleanup.

ia64 is the only architecture defining it, nobody uses it in the kernel.
If the ia64 maintainers want to remove it in a separate patch, that
would probably be a good idea.

I tried not to change the ABI in any way in my patch, and there is
a theoretical possibility that some user space program on ia64 currently
depends on that definition.

	Arnd <><

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21  8:31                 ` Arnd Bergmann
  0 siblings, 0 replies; 62+ messages in thread
From: Arnd Bergmann @ 2009-09-21  8:31 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, ebmunson, linux-kernel, linux-mm, linux-man,
	mtk.manpages, randy.dunlap, rth, ink, Tony Luck, Fenghua Yu,
	linux-ia64

On Friday 18 September 2009, David Rientjes wrote:
> On Fri, 18 Sep 2009, Arnd Bergmann wrote:
>
> > -#define MCL_CURRENT	1		/* lock all current mappings */
> > -#define MCL_FUTURE	2		/* lock all future mappings */
> > +#define MAP_GROWSUP	0x0200		/* register stack-like segment */
> >  
> >  #ifdef __KERNEL__
> >  #ifndef __ASSEMBLY__
> 
> ia64 doesn't use MAP_GROWSUP, so it's probably not necessary to carry it 
> along with your cleanup.

ia64 is the only architecture defining it, nobody uses it in the kernel.
If the ia64 maintainers want to remove it in a separate patch, that
would probably be a good idea.

I tried not to change the ABI in any way in my patch, and there is
a theoretical possibility that some user space program on ia64 currently
depends on that definition.

	Arnd <><

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
  2009-09-21  8:31                 ` Arnd Bergmann
  (?)
@ 2009-09-21  9:13                   ` David Rientjes
  -1 siblings, 0 replies; 62+ messages in thread
From: David Rientjes @ 2009-09-21  9:13 UTC (permalink / raw)
  To: Andrew Morton, Fenghua Yu, Tony Luck
  Cc: ebmunson, linux-kernel, linux-mm, linux-man, mtk.manpages,
	randy.dunlap, rth, ink, linux-ia64, Arnd Bergmann

On Mon, 21 Sep 2009, Arnd Bergmann wrote:

> > > -#define MCL_CURRENT	1		/* lock all current mappings */
> > > -#define MCL_FUTURE	2		/* lock all future mappings */
> > > +#define MAP_GROWSUP	0x0200		/* register stack-like segment */
> > >  
> > >  #ifdef __KERNEL__
> > >  #ifndef __ASSEMBLY__
> > 
> > ia64 doesn't use MAP_GROWSUP, so it's probably not necessary to carry it 
> > along with your cleanup.
> 
> ia64 is the only architecture defining it, nobody uses it in the kernel.
> If the ia64 maintainers want to remove it in a separate patch, that
> would probably be a good idea.
> 

I'll do it then.

> I tried not to change the ABI in any way in my patch, and there is
> a theoretical possibility that some user space program on ia64 currently
> depends on that definition.
> 

I don't buy that as justification, if some userspace program uses it based 
on the false belief that it actually does what it says, it's probably 
better to break their build than perpetuating the lie that it's different 
than ~MAP_GROWSDOWN.


ia64: remove definition for MAP_GROWSUP

MAP_GROWSUP is unused.

Signed-off-by: David Rientjes <rientjes@google.com>
---
diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
--- a/arch/ia64/include/asm/mman.h
+++ b/arch/ia64/include/asm/mman.h
@@ -11,7 +11,6 @@
 #include <asm-generic/mman-common.h>
 
 #define MAP_GROWSDOWN	0x00100		/* stack-like segment */
-#define MAP_GROWSUP	0x00200		/* register stack-like segment */
 #define MAP_DENYWRITE	0x00800		/* ETXTBSY */
 #define MAP_EXECUTABLE	0x01000		/* mark it as an executable */
 #define MAP_LOCKED	0x02000		/* pages are locked */

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21  9:13                   ` David Rientjes
  0 siblings, 0 replies; 62+ messages in thread
From: David Rientjes @ 2009-09-21  9:13 UTC (permalink / raw)
  To: Andrew Morton, Fenghua Yu, Tony Luck
  Cc: ebmunson, linux-kernel, linux-mm, linux-man, mtk.manpages,
	randy.dunlap, rth, ink, linux-ia64, Arnd Bergmann

On Mon, 21 Sep 2009, Arnd Bergmann wrote:

> > > -#define MCL_CURRENT	1		/* lock all current mappings */
> > > -#define MCL_FUTURE	2		/* lock all future mappings */
> > > +#define MAP_GROWSUP	0x0200		/* register stack-like segment */
> > >  
> > >  #ifdef __KERNEL__
> > >  #ifndef __ASSEMBLY__
> > 
> > ia64 doesn't use MAP_GROWSUP, so it's probably not necessary to carry it 
> > along with your cleanup.
> 
> ia64 is the only architecture defining it, nobody uses it in the kernel.
> If the ia64 maintainers want to remove it in a separate patch, that
> would probably be a good idea.
> 

I'll do it then.

> I tried not to change the ABI in any way in my patch, and there is
> a theoretical possibility that some user space program on ia64 currently
> depends on that definition.
> 

I don't buy that as justification, if some userspace program uses it based 
on the false belief that it actually does what it says, it's probably 
better to break their build than perpetuating the lie that it's different 
than ~MAP_GROWSDOWN.


ia64: remove definition for MAP_GROWSUP

MAP_GROWSUP is unused.

Signed-off-by: David Rientjes <rientjes@google.com>
---
diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
--- a/arch/ia64/include/asm/mman.h
+++ b/arch/ia64/include/asm/mman.h
@@ -11,7 +11,6 @@
 #include <asm-generic/mman-common.h>
 
 #define MAP_GROWSDOWN	0x00100		/* stack-like segment */
-#define MAP_GROWSUP	0x00200		/* register stack-like segment */
 #define MAP_DENYWRITE	0x00800		/* ETXTBSY */
 #define MAP_EXECUTABLE	0x01000		/* mark it as an executable */
 #define MAP_LOCKED	0x02000		/* pages are locked */

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21  9:13                   ` David Rientjes
  0 siblings, 0 replies; 62+ messages in thread
From: David Rientjes @ 2009-09-21  9:13 UTC (permalink / raw)
  To: Andrew Morton, Fenghua Yu, Tony Luck
  Cc: ebmunson, linux-kernel, linux-mm, linux-man, mtk.manpages,
	randy.dunlap, rth, ink, linux-ia64, Arnd Bergmann

On Mon, 21 Sep 2009, Arnd Bergmann wrote:

> > > -#define MCL_CURRENT	1		/* lock all current mappings */
> > > -#define MCL_FUTURE	2		/* lock all future mappings */
> > > +#define MAP_GROWSUP	0x0200		/* register stack-like segment */
> > >  
> > >  #ifdef __KERNEL__
> > >  #ifndef __ASSEMBLY__
> > 
> > ia64 doesn't use MAP_GROWSUP, so it's probably not necessary to carry it 
> > along with your cleanup.
> 
> ia64 is the only architecture defining it, nobody uses it in the kernel.
> If the ia64 maintainers want to remove it in a separate patch, that
> would probably be a good idea.
> 

I'll do it then.

> I tried not to change the ABI in any way in my patch, and there is
> a theoretical possibility that some user space program on ia64 currently
> depends on that definition.
> 

I don't buy that as justification, if some userspace program uses it based 
on the false belief that it actually does what it says, it's probably 
better to break their build than perpetuating the lie that it's different 
than ~MAP_GROWSDOWN.


ia64: remove definition for MAP_GROWSUP

MAP_GROWSUP is unused.

Signed-off-by: David Rientjes <rientjes@google.com>
---
diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
--- a/arch/ia64/include/asm/mman.h
+++ b/arch/ia64/include/asm/mman.h
@@ -11,7 +11,6 @@
 #include <asm-generic/mman-common.h>
 
 #define MAP_GROWSDOWN	0x00100		/* stack-like segment */
-#define MAP_GROWSUP	0x00200		/* register stack-like segment */
 #define MAP_DENYWRITE	0x00800		/* ETXTBSY */
 #define MAP_EXECUTABLE	0x01000		/* mark it as an executable */
 #define MAP_LOCKED	0x02000		/* pages are locked */

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
  2009-09-21  9:13                   ` David Rientjes
  (?)
@ 2009-09-21  9:30                     ` Arnd Bergmann
  -1 siblings, 0 replies; 62+ messages in thread
From: Arnd Bergmann @ 2009-09-21  9:30 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, Fenghua Yu, Tony Luck, ebmunson, linux-kernel,
	linux-mm, linux-man, mtk.manpages, randy.dunlap, rth, ink,
	linux-ia64

On Monday 21 September 2009, David Rientjes wrote:
> > I tried not to change the ABI in any way in my patch, and there is
> > a theoretical possibility that some user space program on ia64 currently
> > depends on that definition.
> > 
> 
> I don't buy that as justification, if some userspace program uses it based 
> on the false belief that it actually does what it says, it's probably 
> better to break their build than perpetuating the lie that it's different 
> than ~MAP_GROWSDOWN.

It's more a matter of principle of my patches. I try to strictly separate
patches that move code around (like the one I sent) from those that
change contents (like yours, or the one before that adds MAP_STACK and
MAP_HUGETLB).

Removing a definition from an exported header file either requires
specific knowledge about why it is there to start with, or more
research on the topic than I wanted to do. For instance, a theoretical
program might have a helper function correctly doing

void *xmmap(void *addr, size_t length, int prot, int flags,
                  int fd, off_t offset)
{
	if (flags & MAP_GROWSUP) { /* MAP_GROWSUP is not supported */
		errno = -EINVAL;
		return MAP_FAILED;
	}

	return mmap(addr, length, prot, flags, fd, offset);
}

Of course, such a program would only work on ia64 currently, so
it should be safe to make ia64 behave like the other architectures
in this regard.

> ia64: remove definition for MAP_GROWSUP
> 
> MAP_GROWSUP is unused.
>
> Signed-off-by: David Rientjes <rientjes@google.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21  9:30                     ` Arnd Bergmann
  0 siblings, 0 replies; 62+ messages in thread
From: Arnd Bergmann @ 2009-09-21  9:30 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, Fenghua Yu, Tony Luck, ebmunson, linux-kernel,
	linux-mm, linux-man, mtk.manpages, randy.dunlap, rth, ink,
	linux-ia64

On Monday 21 September 2009, David Rientjes wrote:
> > I tried not to change the ABI in any way in my patch, and there is
> > a theoretical possibility that some user space program on ia64 currently
> > depends on that definition.
> > 
> 
> I don't buy that as justification, if some userspace program uses it based 
> on the false belief that it actually does what it says, it's probably 
> better to break their build than perpetuating the lie that it's different 
> than ~MAP_GROWSDOWN.

It's more a matter of principle of my patches. I try to strictly separate
patches that move code around (like the one I sent) from those that
change contents (like yours, or the one before that adds MAP_STACK and
MAP_HUGETLB).

Removing a definition from an exported header file either requires
specific knowledge about why it is there to start with, or more
research on the topic than I wanted to do. For instance, a theoretical
program might have a helper function correctly doing

void *xmmap(void *addr, size_t length, int prot, int flags,
                  int fd, off_t offset)
{
	if (flags & MAP_GROWSUP) { /* MAP_GROWSUP is not supported */
		errno = -EINVAL;
		return MAP_FAILED;
	}

	return mmap(addr, length, prot, flags, fd, offset);
}

Of course, such a program would only work on ia64 currently, so
it should be safe to make ia64 behave like the other architectures
in this regard.

> ia64: remove definition for MAP_GROWSUP
> 
> MAP_GROWSUP is unused.
>
> Signed-off-by: David Rientjes <rientjes@google.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21  9:30                     ` Arnd Bergmann
  0 siblings, 0 replies; 62+ messages in thread
From: Arnd Bergmann @ 2009-09-21  9:30 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, Fenghua Yu, Tony Luck, ebmunson, linux-kernel,
	linux-mm, linux-man, mtk.manpages, randy.dunlap, rth, ink,
	linux-ia64

On Monday 21 September 2009, David Rientjes wrote:
> > I tried not to change the ABI in any way in my patch, and there is
> > a theoretical possibility that some user space program on ia64 currently
> > depends on that definition.
> > 
> 
> I don't buy that as justification, if some userspace program uses it based 
> on the false belief that it actually does what it says, it's probably 
> better to break their build than perpetuating the lie that it's different 
> than ~MAP_GROWSDOWN.

It's more a matter of principle of my patches. I try to strictly separate
patches that move code around (like the one I sent) from those that
change contents (like yours, or the one before that adds MAP_STACK and
MAP_HUGETLB).

Removing a definition from an exported header file either requires
specific knowledge about why it is there to start with, or more
research on the topic than I wanted to do. For instance, a theoretical
program might have a helper function correctly doing

void *xmmap(void *addr, size_t length, int prot, int flags,
                  int fd, off_t offset)
{
	if (flags & MAP_GROWSUP) { /* MAP_GROWSUP is not supported */
		errno = -EINVAL;
		return MAP_FAILED;
	}

	return mmap(addr, length, prot, flags, fd, offset);
}

Of course, such a program would only work on ia64 currently, so
it should be safe to make ia64 behave like the other architectures
in this regard.

> ia64: remove definition for MAP_GROWSUP
> 
> MAP_GROWSUP is unused.
>
> Signed-off-by: David Rientjes <rientjes@google.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21 12:02                     ` Hugh Dickins
  0 siblings, 0 replies; 62+ messages in thread
From: Hugh Dickins @ 2009-09-21 12:02 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, Fenghua Yu, Tony Luck, ebmunson, linux-kernel,
	linux-mm, linux-man, mtk.manpages, randy.dunlap, rth, ink,
	linux-ia64, Arnd Bergmann

On Mon, 21 Sep 2009, David Rientjes wrote:
> On Mon, 21 Sep 2009, Arnd Bergmann wrote:
> 
> > > > -#define MCL_CURRENT	1		/* lock all current mappings */
> > > > -#define MCL_FUTURE	2		/* lock all future mappings */
> > > > +#define MAP_GROWSUP	0x0200		/* register stack-like segment */
> > > >  
> > > >  #ifdef __KERNEL__
> > > >  #ifndef __ASSEMBLY__
> > > 
> > > ia64 doesn't use MAP_GROWSUP, so it's probably not necessary to carry it 
> > > along with your cleanup.
> > 
> > ia64 is the only architecture defining it, nobody uses it in the kernel.
> > If the ia64 maintainers want to remove it in a separate patch, that
> > would probably be a good idea.
> > 
> 
> I'll do it then.
> 
> > I tried not to change the ABI in any way in my patch, and there is
> > a theoretical possibility that some user space program on ia64 currently
> > depends on that definition.
> > 
> 
> I don't buy that as justification, if some userspace program uses it based 
> on the false belief that it actually does what it says, it's probably 
> better to break their build than perpetuating the lie that it's different 
> than ~MAP_GROWSDOWN.
> 
> 
> ia64: remove definition for MAP_GROWSUP
> 
> MAP_GROWSUP is unused.

Is it perhaps the case that some UNIX on ia64 does implement MAP_GROWSUP,
and these numbers in the Linux ia64 mman.h have been chosen to match that
reference implementation?  Tony will know.  But I wonder if you'd do
better at least to leave a MAP_GROWSUP comment on that line, so that
somebody doesn't go and reuse the empty slot later on.

Hugh

> 
> Signed-off-by: David Rientjes <rientjes@google.com>
> ---
> diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
> --- a/arch/ia64/include/asm/mman.h
> +++ b/arch/ia64/include/asm/mman.h
> @@ -11,7 +11,6 @@
>  #include <asm-generic/mman-common.h>
>  
>  #define MAP_GROWSDOWN	0x00100		/* stack-like segment */
> -#define MAP_GROWSUP	0x00200		/* register stack-like segment */
>  #define MAP_DENYWRITE	0x00800		/* ETXTBSY */
>  #define MAP_EXECUTABLE	0x01000		/* mark it as an executable */
>  #define MAP_LOCKED	0x02000		/* pages are locked */

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21 12:02                     ` Hugh Dickins
  0 siblings, 0 replies; 62+ messages in thread
From: Hugh Dickins @ 2009-09-21 12:02 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, Fenghua Yu, Tony Luck,
	ebmunson-r/Jw6+rmf7HQT0dZR+AlfA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
	linux-man-u79uwXL29TY76Z2rM5mHXA,
	mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA, rth-hL46jP5Bxq7R7s880joybQ,
	ink-biIs/Y0ymYJMZLIVYojuPNP0rXTJTi09,
	linux-ia64-u79uwXL29TY76Z2rM5mHXA, Arnd Bergmann

On Mon, 21 Sep 2009, David Rientjes wrote:
> On Mon, 21 Sep 2009, Arnd Bergmann wrote:
> 
> > > > -#define MCL_CURRENT	1		/* lock all current mappings */
> > > > -#define MCL_FUTURE	2		/* lock all future mappings */
> > > > +#define MAP_GROWSUP	0x0200		/* register stack-like segment */
> > > >  
> > > >  #ifdef __KERNEL__
> > > >  #ifndef __ASSEMBLY__
> > > 
> > > ia64 doesn't use MAP_GROWSUP, so it's probably not necessary to carry it 
> > > along with your cleanup.
> > 
> > ia64 is the only architecture defining it, nobody uses it in the kernel.
> > If the ia64 maintainers want to remove it in a separate patch, that
> > would probably be a good idea.
> > 
> 
> I'll do it then.
> 
> > I tried not to change the ABI in any way in my patch, and there is
> > a theoretical possibility that some user space program on ia64 currently
> > depends on that definition.
> > 
> 
> I don't buy that as justification, if some userspace program uses it based 
> on the false belief that it actually does what it says, it's probably 
> better to break their build than perpetuating the lie that it's different 
> than ~MAP_GROWSDOWN.
> 
> 
> ia64: remove definition for MAP_GROWSUP
> 
> MAP_GROWSUP is unused.

Is it perhaps the case that some UNIX on ia64 does implement MAP_GROWSUP,
and these numbers in the Linux ia64 mman.h have been chosen to match that
reference implementation?  Tony will know.  But I wonder if you'd do
better at least to leave a MAP_GROWSUP comment on that line, so that
somebody doesn't go and reuse the empty slot later on.

Hugh

> 
> Signed-off-by: David Rientjes <rientjes-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> ---
> diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
> --- a/arch/ia64/include/asm/mman.h
> +++ b/arch/ia64/include/asm/mman.h
> @@ -11,7 +11,6 @@
>  #include <asm-generic/mman-common.h>
>  
>  #define MAP_GROWSDOWN	0x00100		/* stack-like segment */
> -#define MAP_GROWSUP	0x00200		/* register stack-like segment */
>  #define MAP_DENYWRITE	0x00800		/* ETXTBSY */
>  #define MAP_EXECUTABLE	0x01000		/* mark it as an executable */
>  #define MAP_LOCKED	0x02000		/* pages are locked */
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21 12:02                     ` Hugh Dickins
  0 siblings, 0 replies; 62+ messages in thread
From: Hugh Dickins @ 2009-09-21 12:02 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, Fenghua Yu, Tony Luck, ebmunson, linux-kernel,
	linux-mm, linux-man, mtk.manpages, randy.dunlap, rth, ink,
	linux-ia64, Arnd Bergmann

On Mon, 21 Sep 2009, David Rientjes wrote:
> On Mon, 21 Sep 2009, Arnd Bergmann wrote:
> 
> > > > -#define MCL_CURRENT	1		/* lock all current mappings */
> > > > -#define MCL_FUTURE	2		/* lock all future mappings */
> > > > +#define MAP_GROWSUP	0x0200		/* register stack-like segment */
> > > >  
> > > >  #ifdef __KERNEL__
> > > >  #ifndef __ASSEMBLY__
> > > 
> > > ia64 doesn't use MAP_GROWSUP, so it's probably not necessary to carry it 
> > > along with your cleanup.
> > 
> > ia64 is the only architecture defining it, nobody uses it in the kernel.
> > If the ia64 maintainers want to remove it in a separate patch, that
> > would probably be a good idea.
> > 
> 
> I'll do it then.
> 
> > I tried not to change the ABI in any way in my patch, and there is
> > a theoretical possibility that some user space program on ia64 currently
> > depends on that definition.
> > 
> 
> I don't buy that as justification, if some userspace program uses it based 
> on the false belief that it actually does what it says, it's probably 
> better to break their build than perpetuating the lie that it's different 
> than ~MAP_GROWSDOWN.
> 
> 
> ia64: remove definition for MAP_GROWSUP
> 
> MAP_GROWSUP is unused.

Is it perhaps the case that some UNIX on ia64 does implement MAP_GROWSUP,
and these numbers in the Linux ia64 mman.h have been chosen to match that
reference implementation?  Tony will know.  But I wonder if you'd do
better at least to leave a MAP_GROWSUP comment on that line, so that
somebody doesn't go and reuse the empty slot later on.

Hugh

> 
> Signed-off-by: David Rientjes <rientjes@google.com>
> ---
> diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
> --- a/arch/ia64/include/asm/mman.h
> +++ b/arch/ia64/include/asm/mman.h
> @@ -11,7 +11,6 @@
>  #include <asm-generic/mman-common.h>
>  
>  #define MAP_GROWSDOWN	0x00100		/* stack-like segment */
> -#define MAP_GROWSUP	0x00200		/* register stack-like segment */
>  #define MAP_DENYWRITE	0x00800		/* ETXTBSY */
>  #define MAP_EXECUTABLE	0x01000		/* mark it as an executable */
>  #define MAP_LOCKED	0x02000		/* pages are locked */

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21 12:02                     ` Hugh Dickins
  0 siblings, 0 replies; 62+ messages in thread
From: Hugh Dickins @ 2009-09-21 12:02 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, Fenghua Yu, Tony Luck, ebmunson, linux-kernel,
	linux-mm, linux-man, mtk.manpages, randy.dunlap, rth, ink,
	linux-ia64, Arnd Bergmann

On Mon, 21 Sep 2009, David Rientjes wrote:
> On Mon, 21 Sep 2009, Arnd Bergmann wrote:
> 
> > > > -#define MCL_CURRENT	1		/* lock all current mappings */
> > > > -#define MCL_FUTURE	2		/* lock all future mappings */
> > > > +#define MAP_GROWSUP	0x0200		/* register stack-like segment */
> > > >  
> > > >  #ifdef __KERNEL__
> > > >  #ifndef __ASSEMBLY__
> > > 
> > > ia64 doesn't use MAP_GROWSUP, so it's probably not necessary to carry it 
> > > along with your cleanup.
> > 
> > ia64 is the only architecture defining it, nobody uses it in the kernel.
> > If the ia64 maintainers want to remove it in a separate patch, that
> > would probably be a good idea.
> > 
> 
> I'll do it then.
> 
> > I tried not to change the ABI in any way in my patch, and there is
> > a theoretical possibility that some user space program on ia64 currently
> > depends on that definition.
> > 
> 
> I don't buy that as justification, if some userspace program uses it based 
> on the false belief that it actually does what it says, it's probably 
> better to break their build than perpetuating the lie that it's different 
> than ~MAP_GROWSDOWN.
> 
> 
> ia64: remove definition for MAP_GROWSUP
> 
> MAP_GROWSUP is unused.

Is it perhaps the case that some UNIX on ia64 does implement MAP_GROWSUP,
and these numbers in the Linux ia64 mman.h have been chosen to match that
reference implementation?  Tony will know.  But I wonder if you'd do
better at least to leave a MAP_GROWSUP comment on that line, so that
somebody doesn't go and reuse the empty slot later on.

Hugh

> 
> Signed-off-by: David Rientjes <rientjes@google.com>
> ---
> diff --git a/arch/ia64/include/asm/mman.h b/arch/ia64/include/asm/mman.h
> --- a/arch/ia64/include/asm/mman.h
> +++ b/arch/ia64/include/asm/mman.h
> @@ -11,7 +11,6 @@
>  #include <asm-generic/mman-common.h>
>  
>  #define MAP_GROWSDOWN	0x00100		/* stack-like segment */
> -#define MAP_GROWSUP	0x00200		/* register stack-like segment */
>  #define MAP_DENYWRITE	0x00800		/* ETXTBSY */
>  #define MAP_EXECUTABLE	0x01000		/* mark it as an executable */
>  #define MAP_LOCKED	0x02000		/* pages are locked */

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
  2009-09-18 15:19           ` Arnd Bergmann
  (?)
  (?)
@ 2009-09-21 12:25           ` Eric B Munson
  -1 siblings, 0 replies; 62+ messages in thread
From: Eric B Munson @ 2009-09-21 12:25 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andrew Morton, linux-kernel, linux-mm, linux-man, mtk.manpages,
	randy.dunlap, rth, ink

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

On Fri, 18 Sep 2009, Arnd Bergmann wrote:

> This patch adds a flag for mmap that will be used to request a huge
> page region that will look like anonymous memory to user space.  This
> is accomplished by using a file on the internal vfsmount.  MAP_HUGETLB
> is a modifier of MAP_ANONYMOUS and so must be specified with it.  The
> region will behave the same as a MAP_ANONYMOUS region using small pages.
> 
> The patch also adds the MAP_STACK flag, which was previously defined
> only on some architectures but not on others. Since MAP_STACK is meant
> to be a hint only, architectures can define it without assigning a
> specific meaning to it.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

I think this is a more sane way of handling the mman flags.

Acked-by: Eric B Munson <ebmunson@us.ibm.com>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
  2009-09-18 16:48             ` Arnd Bergmann
                               ` (2 preceding siblings ...)
  (?)
@ 2009-09-21 12:27             ` Eric B Munson
  -1 siblings, 0 replies; 62+ messages in thread
From: Eric B Munson @ 2009-09-21 12:27 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andrew Morton, linux-kernel, linux-mm, linux-man, mtk.manpages,
	randy.dunlap, rth, ink

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

On Fri, 18 Sep 2009, Arnd Bergmann wrote:

> A number of architectures have identical asm/mman.h files,
> x86 differs only in a single line, so they can all be merged
> by using the new generic file.
> 
> The remaining asm/mman.h files are substantially different
> from each other.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Eric B Munson <ebmunson@us.ibm.com>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
  2009-09-21 12:02                     ` Hugh Dickins
  (?)
@ 2009-09-21 22:55                       ` David Rientjes
  -1 siblings, 0 replies; 62+ messages in thread
From: David Rientjes @ 2009-09-21 22:55 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Andrew Morton, Fenghua Yu, Tony Luck, ebmunson, linux-kernel,
	linux-mm, linux-man, mtk.manpages, Randy Dunlap, rth, ink,
	linux-ia64, Arnd Bergmann

On Mon, 21 Sep 2009, Hugh Dickins wrote:

> Is it perhaps the case that some UNIX on ia64 does implement MAP_GROWSUP,
> and these numbers in the Linux ia64 mman.h have been chosen to match that
> reference implementation?  Tony will know.  But I wonder if you'd do
> better at least to leave a MAP_GROWSUP comment on that line, so that
> somebody doesn't go and reuse the empty slot later on.
> 

Reserving the bit from future use by adding a comment may be helpful, but 
then let's do it for MAP_GROWSDOWN too.

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21 22:55                       ` David Rientjes
  0 siblings, 0 replies; 62+ messages in thread
From: David Rientjes @ 2009-09-21 22:55 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Andrew Morton, Fenghua Yu, Tony Luck, ebmunson, linux-kernel,
	linux-mm, linux-man, mtk.manpages, Randy Dunlap, rth, ink,
	linux-ia64, Arnd Bergmann

On Mon, 21 Sep 2009, Hugh Dickins wrote:

> Is it perhaps the case that some UNIX on ia64 does implement MAP_GROWSUP,
> and these numbers in the Linux ia64 mman.h have been chosen to match that
> reference implementation?  Tony will know.  But I wonder if you'd do
> better at least to leave a MAP_GROWSUP comment on that line, so that
> somebody doesn't go and reuse the empty slot later on.
> 

Reserving the bit from future use by adding a comment may be helpful, but 
then let's do it for MAP_GROWSDOWN too.

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21 22:55                       ` David Rientjes
  0 siblings, 0 replies; 62+ messages in thread
From: David Rientjes @ 2009-09-21 22:55 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Andrew Morton, Fenghua Yu, Tony Luck, ebmunson, linux-kernel,
	linux-mm, linux-man, mtk.manpages, Randy Dunlap, rth, ink,
	linux-ia64, Arnd Bergmann

On Mon, 21 Sep 2009, Hugh Dickins wrote:

> Is it perhaps the case that some UNIX on ia64 does implement MAP_GROWSUP,
> and these numbers in the Linux ia64 mman.h have been chosen to match that
> reference implementation?  Tony will know.  But I wonder if you'd do
> better at least to leave a MAP_GROWSUP comment on that line, so that
> somebody doesn't go and reuse the empty slot later on.
> 

Reserving the bit from future use by adding a comment may be helpful, but 
then let's do it for MAP_GROWSDOWN too.

^ permalink raw reply	[flat|nested] 62+ messages in thread

* RE: [PATCH] remove duplicate asm/mman.h files
  2009-09-21 22:55                       ` David Rientjes
  (?)
@ 2009-09-21 23:25                         ` Luck, Tony
  -1 siblings, 0 replies; 62+ messages in thread
From: Luck, Tony @ 2009-09-21 23:25 UTC (permalink / raw)
  To: David Rientjes, Hugh Dickins
  Cc: Andrew Morton, Yu, Fenghua, ebmunson, linux-kernel, linux-mm,
	linux-man, mtk.manpages, Randy Dunlap, rth, ink, linux-ia64,
	Arnd Bergmann

>> Is it perhaps the case that some UNIX on ia64 does implement MAP_GROWSUP,
>> and these numbers in the Linux ia64 mman.h have been chosen to match that
>> reference implementation?  Tony will know.  But I wonder if you'd do
>> better at least to leave a MAP_GROWSUP comment on that line, so that
>> somebody doesn't go and reuse the empty slot later on.
>> 
>
> Reserving the bit from future use by adding a comment may be helpful, but 
> then let's do it for MAP_GROWSDOWN too.

Tony can only speculate because this bit has been in asm/mman.h
since before I started working on Linux (it is in the 2.4.0
version ... which is roughly when I started ... and long before
I was responsible for it).

Perhaps it was assumed that it would be useful?  Linux/ia64 does
use upwardly growing memory areas (the h/w register stack engine
saves "stack" registers to an area that grows upwards).

But since we have survived this long without it actually being
implemented, it may be true that we don't really need it after
all.

-Tony

^ permalink raw reply	[flat|nested] 62+ messages in thread

* RE: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21 23:25                         ` Luck, Tony
  0 siblings, 0 replies; 62+ messages in thread
From: Luck, Tony @ 2009-09-21 23:25 UTC (permalink / raw)
  To: David Rientjes, Hugh Dickins
  Cc: Andrew Morton, Yu, Fenghua, ebmunson, linux-kernel, linux-mm,
	linux-man, mtk.manpages, Randy Dunlap, rth, ink, linux-ia64,
	Arnd Bergmann

>> Is it perhaps the case that some UNIX on ia64 does implement MAP_GROWSUP,
>> and these numbers in the Linux ia64 mman.h have been chosen to match that
>> reference implementation?  Tony will know.  But I wonder if you'd do
>> better at least to leave a MAP_GROWSUP comment on that line, so that
>> somebody doesn't go and reuse the empty slot later on.
>> 
>
> Reserving the bit from future use by adding a comment may be helpful, but 
> then let's do it for MAP_GROWSDOWN too.

Tony can only speculate because this bit has been in asm/mman.h
since before I started working on Linux (it is in the 2.4.0
version ... which is roughly when I started ... and long before
I was responsible for it).

Perhaps it was assumed that it would be useful?  Linux/ia64 does
use upwardly growing memory areas (the h/w register stack engine
saves "stack" registers to an area that grows upwards).

But since we have survived this long without it actually being
implemented, it may be true that we don't really need it after
all.

-Tony

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* RE: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21 23:25                         ` Luck, Tony
  0 siblings, 0 replies; 62+ messages in thread
From: Luck, Tony @ 2009-09-21 23:25 UTC (permalink / raw)
  To: David Rientjes, Hugh Dickins
  Cc: Andrew Morton, Yu, Fenghua, ebmunson, linux-kernel, linux-mm,
	linux-man, mtk.manpages, Randy Dunlap, rth, ink, linux-ia64,
	Arnd Bergmann

>> Is it perhaps the case that some UNIX on ia64 does implement MAP_GROWSUP,
>> and these numbers in the Linux ia64 mman.h have been chosen to match that
>> reference implementation?  Tony will know.  But I wonder if you'd do
>> better at least to leave a MAP_GROWSUP comment on that line, so that
>> somebody doesn't go and reuse the empty slot later on.
>> 
>
> Reserving the bit from future use by adding a comment may be helpful, but 
> then let's do it for MAP_GROWSDOWN too.

Tony can only speculate because this bit has been in asm/mman.h
since before I started working on Linux (it is in the 2.4.0
version ... which is roughly when I started ... and long before
I was responsible for it).

Perhaps it was assumed that it would be useful?  Linux/ia64 does
use upwardly growing memory areas (the h/w register stack engine
saves "stack" registers to an area that grows upwards).

But since we have survived this long without it actually being
implemented, it may be true that we don't really need it after
all.

-Tony

^ permalink raw reply	[flat|nested] 62+ messages in thread

* RE: [PATCH] remove duplicate asm/mman.h files
  2009-09-21 23:25                         ` Luck, Tony
  (?)
@ 2009-09-21 23:46                           ` David Rientjes
  -1 siblings, 0 replies; 62+ messages in thread
From: David Rientjes @ 2009-09-21 23:46 UTC (permalink / raw)
  To: Luck, Tony
  Cc: Hugh Dickins, Andrew Morton, Yu, Fenghua, ebmunson, linux-kernel,
	linux-mm, linux-man, mtk.manpages, Randy Dunlap, rth, ink,
	linux-ia64, Arnd Bergmann, Ulrich Drepper, Alan Cox

On Mon, 21 Sep 2009, Luck, Tony wrote:

> >> Is it perhaps the case that some UNIX on ia64 does implement MAP_GROWSUP,
> >> and these numbers in the Linux ia64 mman.h have been chosen to match that
> >> reference implementation?  Tony will know.  But I wonder if you'd do
> >> better at least to leave a MAP_GROWSUP comment on that line, so that
> >> somebody doesn't go and reuse the empty slot later on.
> >> 
> >
> > Reserving the bit from future use by adding a comment may be helpful, but 
> > then let's do it for MAP_GROWSDOWN too.
> 
> Tony can only speculate because this bit has been in asm/mman.h
> since before I started working on Linux (it is in the 2.4.0
> version ... which is roughly when I started ... and long before
> I was responsible for it).
> 
> Perhaps it was assumed that it would be useful?  Linux/ia64 does
> use upwardly growing memory areas (the h/w register stack engine
> saves "stack" registers to an area that grows upwards).
> 
> But since we have survived this long without it actually being
> implemented, it may be true that we don't really need it after
> all.
> 

glibc notes that both MAP_GROWSUP and MAP_GROWSDOWN are specific to Linux,
yet they don't functionally do anything.  While it may be true that 
there's no cost associated with keeping them around, I also think 
exporting such flags to userspace may give developers the belief that the 
implementation actually respects them when they're passed.

Ulrich wanted to do this last year but it appears to have been dropped.

Unless there's a convincing argument in the other direction, I don't see 
why they both can't just be removed and their bits reserved.

^ permalink raw reply	[flat|nested] 62+ messages in thread

* RE: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21 23:46                           ` David Rientjes
  0 siblings, 0 replies; 62+ messages in thread
From: David Rientjes @ 2009-09-21 23:46 UTC (permalink / raw)
  To: Luck, Tony
  Cc: Hugh Dickins, Andrew Morton, Yu, Fenghua, ebmunson, linux-kernel,
	linux-mm, linux-man, mtk.manpages, Randy Dunlap, rth, ink,
	linux-ia64, Arnd Bergmann, Ulrich Drepper, Alan Cox

On Mon, 21 Sep 2009, Luck, Tony wrote:

> >> Is it perhaps the case that some UNIX on ia64 does implement MAP_GROWSUP,
> >> and these numbers in the Linux ia64 mman.h have been chosen to match that
> >> reference implementation?  Tony will know.  But I wonder if you'd do
> >> better at least to leave a MAP_GROWSUP comment on that line, so that
> >> somebody doesn't go and reuse the empty slot later on.
> >> 
> >
> > Reserving the bit from future use by adding a comment may be helpful, but 
> > then let's do it for MAP_GROWSDOWN too.
> 
> Tony can only speculate because this bit has been in asm/mman.h
> since before I started working on Linux (it is in the 2.4.0
> version ... which is roughly when I started ... and long before
> I was responsible for it).
> 
> Perhaps it was assumed that it would be useful?  Linux/ia64 does
> use upwardly growing memory areas (the h/w register stack engine
> saves "stack" registers to an area that grows upwards).
> 
> But since we have survived this long without it actually being
> implemented, it may be true that we don't really need it after
> all.
> 

glibc notes that both MAP_GROWSUP and MAP_GROWSDOWN are specific to Linux,
yet they don't functionally do anything.  While it may be true that 
there's no cost associated with keeping them around, I also think 
exporting such flags to userspace may give developers the belief that the 
implementation actually respects them when they're passed.

Ulrich wanted to do this last year but it appears to have been dropped.

Unless there's a convincing argument in the other direction, I don't see 
why they both can't just be removed and their bits reserved.

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* RE: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21 23:46                           ` David Rientjes
  0 siblings, 0 replies; 62+ messages in thread
From: David Rientjes @ 2009-09-21 23:46 UTC (permalink / raw)
  To: Luck, Tony
  Cc: Hugh Dickins, Andrew Morton, Yu, Fenghua, ebmunson, linux-kernel,
	linux-mm, linux-man, mtk.manpages, Randy Dunlap, rth, ink,
	linux-ia64, Arnd Bergmann, Ulrich Drepper, Alan Cox

On Mon, 21 Sep 2009, Luck, Tony wrote:

> >> Is it perhaps the case that some UNIX on ia64 does implement MAP_GROWSUP,
> >> and these numbers in the Linux ia64 mman.h have been chosen to match that
> >> reference implementation?  Tony will know.  But I wonder if you'd do
> >> better at least to leave a MAP_GROWSUP comment on that line, so that
> >> somebody doesn't go and reuse the empty slot later on.
> >> 
> >
> > Reserving the bit from future use by adding a comment may be helpful, but 
> > then let's do it for MAP_GROWSDOWN too.
> 
> Tony can only speculate because this bit has been in asm/mman.h
> since before I started working on Linux (it is in the 2.4.0
> version ... which is roughly when I started ... and long before
> I was responsible for it).
> 
> Perhaps it was assumed that it would be useful?  Linux/ia64 does
> use upwardly growing memory areas (the h/w register stack engine
> saves "stack" registers to an area that grows upwards).
> 
> But since we have survived this long without it actually being
> implemented, it may be true that we don't really need it after
> all.
> 

glibc notes that both MAP_GROWSUP and MAP_GROWSDOWN are specific to Linux,
yet they don't functionally do anything.  While it may be true that 
there's no cost associated with keeping them around, I also think 
exporting such flags to userspace may give developers the belief that the 
implementation actually respects them when they're passed.

Ulrich wanted to do this last year but it appears to have been dropped.

Unless there's a convincing argument in the other direction, I don't see 
why they both can't just be removed and their bits reserved.

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
  2009-09-21 23:46                           ` David Rientjes
  (?)
  (?)
@ 2009-09-21 23:58                             ` Ulrich Drepper
  -1 siblings, 0 replies; 62+ messages in thread
From: Ulrich Drepper @ 2009-09-21 23:58 UTC (permalink / raw)
  To: David Rientjes
  Cc: Luck, Tony, Hugh Dickins, Andrew Morton, Yu, Fenghua, ebmunson,
	linux-kernel, linux-mm, linux-man, mtk.manpages, Randy Dunlap,
	rth, ink, linux-ia64, Arnd Bergmann, Alan Cox

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David Rientjes wrote:
> Ulrich wanted to do this last year but it appears to have been dropped.

I've mentioned that at that time, these flags cannot be used at all for
stacks.  And I don't know for what else it is useful.  They should
really be removed.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkq4Ez0ACgkQ2ijCOnn/RHQNtACfX+y5pIQhDusikKiQwQ8nvGRN
cI8An0oThAXSwXRALt9598vbPbiVwEeJ
=sxfU
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21 23:58                             ` Ulrich Drepper
  0 siblings, 0 replies; 62+ messages in thread
From: Ulrich Drepper @ 2009-09-21 23:58 UTC (permalink / raw)
  To: David Rientjes
  Cc: Luck, Tony, Hugh Dickins, Andrew Morton, Yu, Fenghua, ebmunson,
	linux-kernel, linux-mm, linux-man, mtk.manpages, Randy Dunlap,
	rth, ink, linux-ia64, Arnd Bergmann, Alan Cox

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David Rientjes wrote:
> Ulrich wanted to do this last year but it appears to have been dropped.

I've mentioned that at that time, these flags cannot be used at all for
stacks.  And I don't know for what else it is useful.  They should
really be removed.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkq4Ez0ACgkQ2ijCOnn/RHQNtACfX+y5pIQhDusikKiQwQ8nvGRN
cI8An0oThAXSwXRALt9598vbPbiVwEeJ
=sxfU
-----END PGP SIGNATURE-----

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21 23:58                             ` Ulrich Drepper
  0 siblings, 0 replies; 62+ messages in thread
From: Ulrich Drepper @ 2009-09-21 23:58 UTC (permalink / raw)
  To: David Rientjes
  Cc: Luck, Tony, Hugh Dickins, Andrew Morton, Yu, Fenghua, ebmunson,
	linux-kernel, linux-mm, linux-man, mtk.manpages, Randy Dunlap,
	rth, ink, linux-ia64, Arnd Bergmann, Alan Cox

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David Rientjes wrote:
> Ulrich wanted to do this last year but it appears to have been dropped.

I've mentioned that at that time, these flags cannot be used at all for
stacks.  And I don't know for what else it is useful.  They should
really be removed.

- --
a?? Ulrich Drepper a?? Red Hat, Inc. a?? 444 Castro St a?? Mountain View, CA a??
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkq4Ez0ACgkQ2ijCOnn/RHQNtACfX+y5pIQhDusikKiQwQ8nvGRN
cI8An0oThAXSwXRALt9598vbPbiVwEeJ
=sxfU
-----END PGP SIGNATURE-----

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH] remove duplicate asm/mman.h files
@ 2009-09-21 23:58                             ` Ulrich Drepper
  0 siblings, 0 replies; 62+ messages in thread
From: Ulrich Drepper @ 2009-09-21 23:58 UTC (permalink / raw)
  To: David Rientjes
  Cc: Luck, Tony, Hugh Dickins, Andrew Morton, Yu, Fenghua, ebmunson,
	linux-kernel, linux-mm, linux-man, mtk.manpages, Randy Dunlap,
	rth, ink, linux-ia64, Arnd Bergmann, Alan Cox

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David Rientjes wrote:
> Ulrich wanted to do this last year but it appears to have been dropped.

I've mentioned that at that time, these flags cannot be used at all for
stacks.  And I don't know for what else it is useful.  They should
really be removed.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkq4Ez0ACgkQ2ijCOnn/RHQNtACfX+y5pIQhDusikKiQwQ8nvGRN
cI8An0oThAXSwXRALt9598vbPbiVwEeJ
=sxfU
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
@ 2009-09-02  8:34                 ` Arnd Bergmann
  0 siblings, 0 replies; 62+ messages in thread
From: Arnd Bergmann @ 2009-09-02  8:34 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Eric B Munson, Mel Gorman, linux-kernel, linux-mm, akpm,
	linux-man, Michael Kerrisk, randy.dunlap

On Tuesday 01 September 2009, Hugh Dickins wrote:
> On Tue, 1 Sep 2009, Eric B Munson wrote:
> > On Tue, 01 Sep 2009, Hugh Dickins wrote:
> > > 
> > > That is explained by you #defining MAP_HUGETLB in include/asm-generic/
> > > mman-common.h to a number which is already being used for other MAP_s
> > > on some architectures.  That's a separate bug which needs to be fixed
> > > by distributing the MAP_HUGETLB definition across various asm*/mman.h.
> > 
> > Would it be okay to keep the define in include/asm-generic/mman.h
> > if a value that is known free across all architectures is used?
> > 0x080000 is not used by any arch and, AFAICT would work just as well.
> 
> That's a very sensible suggestion, but departs from how we have
> assigned new numbers up until now: so include/asm-generic/mman-common.h
> isn't actually where we'd expect to find a Linux-specific MAP_ define.
> 
> I'd say, yes, do that for now, so as not to hit this conflict while
> testing in mmotm.  But whether it should stay that way, or later the
> arch/*/include/asm/mman.h's be updated as I'd imagined, I don't know.
> 
> Arnd, Michael, do you have any views on this?

The minimal procedure would be to add it to mman-common.h, plus
the asm/mman.h files for xtensa, mips, parisc and alpha, which all
use a version that is compatible to a Unix variant, but that would
be confusing the next person that needs to add a flag.

I'd use the number 0x40000 for all architectures except alpha,
because that makes the most sense for asm-generic/mman.h. Alpha
is weird anyway here, so we don't need to avoid conflicts with it.

With a few exceptions (sparc, powerpc), I think we should change
all architectures to use asm-generic/mman.h instead of mman-common.h
in the long run. If you touch those anyway, one option would be
to do it in one step.

	Arnd <><

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
@ 2009-09-02  8:34                 ` Arnd Bergmann
  0 siblings, 0 replies; 62+ messages in thread
From: Arnd Bergmann @ 2009-09-02  8:34 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Eric B Munson, Mel Gorman, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	linux-man-u79uwXL29TY76Z2rM5mHXA, Michael Kerrisk,
	randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA

On Tuesday 01 September 2009, Hugh Dickins wrote:
> On Tue, 1 Sep 2009, Eric B Munson wrote:
> > On Tue, 01 Sep 2009, Hugh Dickins wrote:
> > > 
> > > That is explained by you #defining MAP_HUGETLB in include/asm-generic/
> > > mman-common.h to a number which is already being used for other MAP_s
> > > on some architectures.  That's a separate bug which needs to be fixed
> > > by distributing the MAP_HUGETLB definition across various asm*/mman.h.
> > 
> > Would it be okay to keep the define in include/asm-generic/mman.h
> > if a value that is known free across all architectures is used?
> > 0x080000 is not used by any arch and, AFAICT would work just as well.
> 
> That's a very sensible suggestion, but departs from how we have
> assigned new numbers up until now: so include/asm-generic/mman-common.h
> isn't actually where we'd expect to find a Linux-specific MAP_ define.
> 
> I'd say, yes, do that for now, so as not to hit this conflict while
> testing in mmotm.  But whether it should stay that way, or later the
> arch/*/include/asm/mman.h's be updated as I'd imagined, I don't know.
> 
> Arnd, Michael, do you have any views on this?

The minimal procedure would be to add it to mman-common.h, plus
the asm/mman.h files for xtensa, mips, parisc and alpha, which all
use a version that is compatible to a Unix variant, but that would
be confusing the next person that needs to add a flag.

I'd use the number 0x40000 for all architectures except alpha,
because that makes the most sense for asm-generic/mman.h. Alpha
is weird anyway here, so we don't need to avoid conflicts with it.

With a few exceptions (sparc, powerpc), I think we should change
all architectures to use asm-generic/mman.h instead of mman-common.h
in the long run. If you touch those anyway, one option would be
to do it in one step.

	Arnd <><
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
@ 2009-09-02  8:34                 ` Arnd Bergmann
  0 siblings, 0 replies; 62+ messages in thread
From: Arnd Bergmann @ 2009-09-02  8:34 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Eric B Munson, Mel Gorman, linux-kernel, linux-mm, akpm,
	linux-man, Michael Kerrisk, randy.dunlap

On Tuesday 01 September 2009, Hugh Dickins wrote:
> On Tue, 1 Sep 2009, Eric B Munson wrote:
> > On Tue, 01 Sep 2009, Hugh Dickins wrote:
> > > 
> > > That is explained by you #defining MAP_HUGETLB in include/asm-generic/
> > > mman-common.h to a number which is already being used for other MAP_s
> > > on some architectures.  That's a separate bug which needs to be fixed
> > > by distributing the MAP_HUGETLB definition across various asm*/mman.h.
> > 
> > Would it be okay to keep the define in include/asm-generic/mman.h
> > if a value that is known free across all architectures is used?
> > 0x080000 is not used by any arch and, AFAICT would work just as well.
> 
> That's a very sensible suggestion, but departs from how we have
> assigned new numbers up until now: so include/asm-generic/mman-common.h
> isn't actually where we'd expect to find a Linux-specific MAP_ define.
> 
> I'd say, yes, do that for now, so as not to hit this conflict while
> testing in mmotm.  But whether it should stay that way, or later the
> arch/*/include/asm/mman.h's be updated as I'd imagined, I don't know.
> 
> Arnd, Michael, do you have any views on this?

The minimal procedure would be to add it to mman-common.h, plus
the asm/mman.h files for xtensa, mips, parisc and alpha, which all
use a version that is compatible to a Unix variant, but that would
be confusing the next person that needs to add a flag.

I'd use the number 0x40000 for all architectures except alpha,
because that makes the most sense for asm-generic/mman.h. Alpha
is weird anyway here, so we don't need to avoid conflicts with it.

With a few exceptions (sparc, powerpc), I think we should change
all architectures to use asm-generic/mman.h instead of mman-common.h
in the long run. If you touch those anyway, one option would be
to do it in one step.

	Arnd <><

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
@ 2009-09-01 13:34               ` Hugh Dickins
  0 siblings, 0 replies; 62+ messages in thread
From: Hugh Dickins @ 2009-09-01 13:34 UTC (permalink / raw)
  To: Eric B Munson
  Cc: Arnd Bergman, Mel Gorman, linux-kernel, linux-mm, akpm,
	linux-man, Michael Kerrisk, randy.dunlap

On Tue, 1 Sep 2009, Eric B Munson wrote:
> On Tue, 01 Sep 2009, Hugh Dickins wrote:
> > 
> > That is explained by you #defining MAP_HUGETLB in include/asm-generic/
> > mman-common.h to a number which is already being used for other MAP_s
> > on some architectures.  That's a separate bug which needs to be fixed
> > by distributing the MAP_HUGETLB definition across various asm*/mman.h.
> 
> Would it be okay to keep the define in include/asm-generic/mman.h
> if a value that is known free across all architectures is used?
> 0x080000 is not used by any arch and, AFAICT would work just as well.

That's a very sensible suggestion, but departs from how we have
assigned new numbers up until now: so include/asm-generic/mman-common.h
isn't actually where we'd expect to find a Linux-specific MAP_ define.

I'd say, yes, do that for now, so as not to hit this conflict while
testing in mmotm.  But whether it should stay that way, or later the
arch/*/include/asm/mman.h's be updated as I'd imagined, I don't know.

Arnd, Michael, do you have any views on this?

Thanks,
Hugh

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
@ 2009-09-01 13:34               ` Hugh Dickins
  0 siblings, 0 replies; 62+ messages in thread
From: Hugh Dickins @ 2009-09-01 13:34 UTC (permalink / raw)
  To: Eric B Munson
  Cc: Arnd Bergman, Mel Gorman, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	linux-man-u79uwXL29TY76Z2rM5mHXA, Michael Kerrisk,
	randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA

On Tue, 1 Sep 2009, Eric B Munson wrote:
> On Tue, 01 Sep 2009, Hugh Dickins wrote:
> > 
> > That is explained by you #defining MAP_HUGETLB in include/asm-generic/
> > mman-common.h to a number which is already being used for other MAP_s
> > on some architectures.  That's a separate bug which needs to be fixed
> > by distributing the MAP_HUGETLB definition across various asm*/mman.h.
> 
> Would it be okay to keep the define in include/asm-generic/mman.h
> if a value that is known free across all architectures is used?
> 0x080000 is not used by any arch and, AFAICT would work just as well.

That's a very sensible suggestion, but departs from how we have
assigned new numbers up until now: so include/asm-generic/mman-common.h
isn't actually where we'd expect to find a Linux-specific MAP_ define.

I'd say, yes, do that for now, so as not to hit this conflict while
testing in mmotm.  But whether it should stay that way, or later the
arch/*/include/asm/mman.h's be updated as I'd imagined, I don't know.

Arnd, Michael, do you have any views on this?

Thanks,
Hugh
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
@ 2009-09-01 13:34               ` Hugh Dickins
  0 siblings, 0 replies; 62+ messages in thread
From: Hugh Dickins @ 2009-09-01 13:34 UTC (permalink / raw)
  To: Eric B Munson
  Cc: Arnd Bergman, Mel Gorman, linux-kernel, linux-mm, akpm,
	linux-man, Michael Kerrisk, randy.dunlap

On Tue, 1 Sep 2009, Eric B Munson wrote:
> On Tue, 01 Sep 2009, Hugh Dickins wrote:
> > 
> > That is explained by you #defining MAP_HUGETLB in include/asm-generic/
> > mman-common.h to a number which is already being used for other MAP_s
> > on some architectures.  That's a separate bug which needs to be fixed
> > by distributing the MAP_HUGETLB definition across various asm*/mman.h.
> 
> Would it be okay to keep the define in include/asm-generic/mman.h
> if a value that is known free across all architectures is used?
> 0x080000 is not used by any arch and, AFAICT would work just as well.

That's a very sensible suggestion, but departs from how we have
assigned new numbers up until now: so include/asm-generic/mman-common.h
isn't actually where we'd expect to find a Linux-specific MAP_ define.

I'd say, yes, do that for now, so as not to hit this conflict while
testing in mmotm.  But whether it should stay that way, or later the
arch/*/include/asm/mman.h's be updated as I'd imagined, I don't know.

Arnd, Michael, do you have any views on this?

Thanks,
Hugh

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
  2009-09-01 10:41           ` Hugh Dickins
  (?)
  (?)
@ 2009-09-01 13:08           ` Eric B Munson
  2009-09-01 13:34               ` Hugh Dickins
  -1 siblings, 1 reply; 62+ messages in thread
From: Eric B Munson @ 2009-09-01 13:08 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Mel Gorman, linux-kernel, linux-mm, akpm, linux-man,
	mtk.manpages, randy.dunlap

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

On Tue, 01 Sep 2009, Hugh Dickins wrote:

snip

> 
> Sorry, no, I disagree.
> 
> I agree that the fs/hugetlbfs/inode.c:941 message and backtrace in
> themselves are symptoms of the can_do_hugetlb_shm() bug that Mel
> reported and fixed (I'm agreeing a little too readily, I've not
> actually studied that bug and fix, I'm taking it on trust).
> 
> But that does not explain how last year's openSUSE 11.1 userspace
> was trying for a MAP_HUGETLB mapping at startup on PowerPC (but
> not on x86), while you're only introducing MAP_HUGETLB now.
> 
> That is explained by you #defining MAP_HUGETLB in include/asm-generic/
> mman-common.h to a number which is already being used for other MAP_s
> on some architectures.  That's a separate bug which needs to be fixed
> by distributing the MAP_HUGETLB definition across various asm*/mman.h.
> 
> Hugh
> 

Would it be okay to keep the define in include/asm-generic/mman.h
if a value that is known free across all architectures is used?
0x080000 is not used by any arch and, AFAICT would work just as well.

-- 
Eric B Munson
IBM Linux Technology Center
ebmunson@us.ibm.com


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
@ 2009-09-01 10:41           ` Hugh Dickins
  0 siblings, 0 replies; 62+ messages in thread
From: Hugh Dickins @ 2009-09-01 10:41 UTC (permalink / raw)
  To: Eric B Munson
  Cc: Mel Gorman, linux-kernel, linux-mm, akpm, linux-man,
	mtk.manpages, randy.dunlap

On Tue, 1 Sep 2009, Eric B Munson wrote:
> On Mon, 31 Aug 2009, Hugh Dickins wrote:
> > On Wed, 26 Aug 2009, Eric B Munson wrote:
> > > This patch adds a flag for mmap that will be used to request a huge
> > > page region that will look like anonymous memory to user space.  This
> > > is accomplished by using a file on the internal vfsmount.  MAP_HUGETLB
> > > is a modifier of MAP_ANONYMOUS and so must be specified with it.  The
> > > region will behave the same as a MAP_ANONYMOUS region using small pages.
> > > 
> > > Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
> > > ---
> > >  include/asm-generic/mman-common.h |    1 +
> > >  include/linux/hugetlb.h           |    7 +++++++
> > >  mm/mmap.c                         |   19 +++++++++++++++++++
> > >  3 files changed, 27 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h
> > > index 3b69ad3..12f5982 100644
> > > --- a/include/asm-generic/mman-common.h
> > > +++ b/include/asm-generic/mman-common.h
> > > @@ -19,6 +19,7 @@
> > >  #define MAP_TYPE	0x0f		/* Mask for type of mapping */
> > >  #define MAP_FIXED	0x10		/* Interpret addr exactly */
> > >  #define MAP_ANONYMOUS	0x20		/* don't use a file */
> > > +#define MAP_HUGETLB	0x40		/* create a huge page mapping */
> > >  
> > >  #define MS_ASYNC	1		/* sync memory asynchronously */
> > >  #define MS_INVALIDATE	2		/* invalidate the caches */
> > 
> > I'm afraid you can't put MAP_HUGETLB in mman-common.h: that is picked
> > up by most or all architectures (which is of course what you wanted!)
> > but conflicts with a definition in at least one of them.  When I boot
> > up mmotm on powerpc, I get a warning:
> > 
> > Using mlock ulimits for SHM_HUGETLB deprecated
> > ------------[ cut here ]------------
> > Badness at fs/hugetlbfs/inode.c:941
> > NIP: c0000000001f3038 LR: c0000000001f3034 CTR: 0000000000000000
> > REGS: c0000000275d7960 TRAP: 0700   Not tainted  (2.6.31-rc7-mm2)
> > MSR: 9000000000029032 <EE,ME,CE,IR,DR>  CR: 24000484  XER: 00000000
> > TASK = c000000029fa94a0[1321] 'console-kit-dae' THREAD: c0000000275d4000 CPU: 3
> > GPR00: c0000000001f3034 c0000000275d7be0 c00000000071a908 0000000000000032 
> > GPR04: 0000000000000000 ffffffffffffffff ffffffffffffffff 0000000000000000 
> > GPR08: c0000000297dc1d0 c0000000275d4000 d00008008247fa08 0000000000000000 
> > GPR12: 0000000024000442 c00000000074ba00 000000000fedb9a4 000000001049cd18 
> > GPR16: 00000000100365d0 00000000104a9100 000000000fefc350 00000000104a9098 
> > GPR20: 00000000104a9160 000000000fefc238 0000000000000000 0000000000200000 
> > GPR24: 0000000000000000 0000000001000000 c0000000275d7d20 0000000001000000 
> > GPR28: c00000000058c738 ffffffffffffffb5 c0000000006a93d0 c000000000791400 
> > NIP [c0000000001f3038] .hugetlb_file_setup+0xd0/0x254
> > LR [c0000000001f3034] .hugetlb_file_setup+0xcc/0x254
> > Call Trace:
> > [c0000000275d7be0] [c0000000001f3034] .hugetlb_file_setup+0xcc/0x254 (unreliable)
> > [c0000000275d7cb0] [c0000000000ee240] .do_mmap_pgoff+0x184/0x424
> > [c0000000275d7d80] [c00000000000a9c8] .sys_mmap+0xc4/0x13c
> > [c0000000275d7e30] [c0000000000075ac] syscall_exit+0x0/0x40
> > Instruction dump:
> > f89a0000 4bef7111 60000000 2c230000 41820034 e93e8018 80090014 2f800000 
> > 40fe0030 e87e80b0 4823ff09 60000000 <0fe00000> e93e8018 38000001 90090014 
> > 
> > Which won't be coming from any use of MAP_HUGETLB, but presumably
> > from something using MAP_NORESERVE, defined as 0x40 in
> > arch/powerpc/include/asm/mman.h.
> > 
> > I think you have to put your #define MAP_HUGETLB into
> > include/asm-generic/mman.h (seems used by only three architectures),
> > and into the arch/whatever/include/asm/mman.h of each architecture
> > which uses asm-generic/mman-common.h without asm-generic/mman.h.
> > 
> > Hugh
> > 
> 
> This problem is the same that Mel Gorman reported (and fixed) in response to patch
> 1 of this series.  I have forwarded the patch that addresses this problem on,
> but it has not been picked up.
> 
> The bug is not where MAP_HUGETLB is defined, rather how the patch handled
> can_do_hugetlb_shm().  If MAP_HUGETLB was specified, can_do_hugetlb_shm() returned
> 0 forcing a call to user_shm_lock() which is responisble for the warning about
> SHM_HUGETLB and mlock ulimits.  The fix is to check if the file is to be used
> for SHM_HUGETLB and if not, skip the calls to can_do_hugetlb_shm() and
> user_shm_lock().

Sorry, no, I disagree.

I agree that the fs/hugetlbfs/inode.c:941 message and backtrace in
themselves are symptoms of the can_do_hugetlb_shm() bug that Mel
reported and fixed (I'm agreeing a little too readily, I've not
actually studied that bug and fix, I'm taking it on trust).

But that does not explain how last year's openSUSE 11.1 userspace
was trying for a MAP_HUGETLB mapping at startup on PowerPC (but
not on x86), while you're only introducing MAP_HUGETLB now.

That is explained by you #defining MAP_HUGETLB in include/asm-generic/
mman-common.h to a number which is already being used for other MAP_s
on some architectures.  That's a separate bug which needs to be fixed
by distributing the MAP_HUGETLB definition across various asm*/mman.h.

Hugh

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
@ 2009-09-01 10:41           ` Hugh Dickins
  0 siblings, 0 replies; 62+ messages in thread
From: Hugh Dickins @ 2009-09-01 10:41 UTC (permalink / raw)
  To: Eric B Munson
  Cc: Mel Gorman, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	linux-man-u79uwXL29TY76Z2rM5mHXA,
	mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA

On Tue, 1 Sep 2009, Eric B Munson wrote:
> On Mon, 31 Aug 2009, Hugh Dickins wrote:
> > On Wed, 26 Aug 2009, Eric B Munson wrote:
> > > This patch adds a flag for mmap that will be used to request a huge
> > > page region that will look like anonymous memory to user space.  This
> > > is accomplished by using a file on the internal vfsmount.  MAP_HUGETLB
> > > is a modifier of MAP_ANONYMOUS and so must be specified with it.  The
> > > region will behave the same as a MAP_ANONYMOUS region using small pages.
> > > 
> > > Signed-off-by: Eric B Munson <ebmunson-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> > > ---
> > >  include/asm-generic/mman-common.h |    1 +
> > >  include/linux/hugetlb.h           |    7 +++++++
> > >  mm/mmap.c                         |   19 +++++++++++++++++++
> > >  3 files changed, 27 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h
> > > index 3b69ad3..12f5982 100644
> > > --- a/include/asm-generic/mman-common.h
> > > +++ b/include/asm-generic/mman-common.h
> > > @@ -19,6 +19,7 @@
> > >  #define MAP_TYPE	0x0f		/* Mask for type of mapping */
> > >  #define MAP_FIXED	0x10		/* Interpret addr exactly */
> > >  #define MAP_ANONYMOUS	0x20		/* don't use a file */
> > > +#define MAP_HUGETLB	0x40		/* create a huge page mapping */
> > >  
> > >  #define MS_ASYNC	1		/* sync memory asynchronously */
> > >  #define MS_INVALIDATE	2		/* invalidate the caches */
> > 
> > I'm afraid you can't put MAP_HUGETLB in mman-common.h: that is picked
> > up by most or all architectures (which is of course what you wanted!)
> > but conflicts with a definition in at least one of them.  When I boot
> > up mmotm on powerpc, I get a warning:
> > 
> > Using mlock ulimits for SHM_HUGETLB deprecated
> > ------------[ cut here ]------------
> > Badness at fs/hugetlbfs/inode.c:941
> > NIP: c0000000001f3038 LR: c0000000001f3034 CTR: 0000000000000000
> > REGS: c0000000275d7960 TRAP: 0700   Not tainted  (2.6.31-rc7-mm2)
> > MSR: 9000000000029032 <EE,ME,CE,IR,DR>  CR: 24000484  XER: 00000000
> > TASK = c000000029fa94a0[1321] 'console-kit-dae' THREAD: c0000000275d4000 CPU: 3
> > GPR00: c0000000001f3034 c0000000275d7be0 c00000000071a908 0000000000000032 
> > GPR04: 0000000000000000 ffffffffffffffff ffffffffffffffff 0000000000000000 
> > GPR08: c0000000297dc1d0 c0000000275d4000 d00008008247fa08 0000000000000000 
> > GPR12: 0000000024000442 c00000000074ba00 000000000fedb9a4 000000001049cd18 
> > GPR16: 00000000100365d0 00000000104a9100 000000000fefc350 00000000104a9098 
> > GPR20: 00000000104a9160 000000000fefc238 0000000000000000 0000000000200000 
> > GPR24: 0000000000000000 0000000001000000 c0000000275d7d20 0000000001000000 
> > GPR28: c00000000058c738 ffffffffffffffb5 c0000000006a93d0 c000000000791400 
> > NIP [c0000000001f3038] .hugetlb_file_setup+0xd0/0x254
> > LR [c0000000001f3034] .hugetlb_file_setup+0xcc/0x254
> > Call Trace:
> > [c0000000275d7be0] [c0000000001f3034] .hugetlb_file_setup+0xcc/0x254 (unreliable)
> > [c0000000275d7cb0] [c0000000000ee240] .do_mmap_pgoff+0x184/0x424
> > [c0000000275d7d80] [c00000000000a9c8] .sys_mmap+0xc4/0x13c
> > [c0000000275d7e30] [c0000000000075ac] syscall_exit+0x0/0x40
> > Instruction dump:
> > f89a0000 4bef7111 60000000 2c230000 41820034 e93e8018 80090014 2f800000 
> > 40fe0030 e87e80b0 4823ff09 60000000 <0fe00000> e93e8018 38000001 90090014 
> > 
> > Which won't be coming from any use of MAP_HUGETLB, but presumably
> > from something using MAP_NORESERVE, defined as 0x40 in
> > arch/powerpc/include/asm/mman.h.
> > 
> > I think you have to put your #define MAP_HUGETLB into
> > include/asm-generic/mman.h (seems used by only three architectures),
> > and into the arch/whatever/include/asm/mman.h of each architecture
> > which uses asm-generic/mman-common.h without asm-generic/mman.h.
> > 
> > Hugh
> > 
> 
> This problem is the same that Mel Gorman reported (and fixed) in response to patch
> 1 of this series.  I have forwarded the patch that addresses this problem on,
> but it has not been picked up.
> 
> The bug is not where MAP_HUGETLB is defined, rather how the patch handled
> can_do_hugetlb_shm().  If MAP_HUGETLB was specified, can_do_hugetlb_shm() returned
> 0 forcing a call to user_shm_lock() which is responisble for the warning about
> SHM_HUGETLB and mlock ulimits.  The fix is to check if the file is to be used
> for SHM_HUGETLB and if not, skip the calls to can_do_hugetlb_shm() and
> user_shm_lock().

Sorry, no, I disagree.

I agree that the fs/hugetlbfs/inode.c:941 message and backtrace in
themselves are symptoms of the can_do_hugetlb_shm() bug that Mel
reported and fixed (I'm agreeing a little too readily, I've not
actually studied that bug and fix, I'm taking it on trust).

But that does not explain how last year's openSUSE 11.1 userspace
was trying for a MAP_HUGETLB mapping at startup on PowerPC (but
not on x86), while you're only introducing MAP_HUGETLB now.

That is explained by you #defining MAP_HUGETLB in include/asm-generic/
mman-common.h to a number which is already being used for other MAP_s
on some architectures.  That's a separate bug which needs to be fixed
by distributing the MAP_HUGETLB definition across various asm*/mman.h.

Hugh
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
@ 2009-09-01 10:41           ` Hugh Dickins
  0 siblings, 0 replies; 62+ messages in thread
From: Hugh Dickins @ 2009-09-01 10:41 UTC (permalink / raw)
  To: Eric B Munson
  Cc: Mel Gorman, linux-kernel, linux-mm, akpm, linux-man,
	mtk.manpages, randy.dunlap

On Tue, 1 Sep 2009, Eric B Munson wrote:
> On Mon, 31 Aug 2009, Hugh Dickins wrote:
> > On Wed, 26 Aug 2009, Eric B Munson wrote:
> > > This patch adds a flag for mmap that will be used to request a huge
> > > page region that will look like anonymous memory to user space.  This
> > > is accomplished by using a file on the internal vfsmount.  MAP_HUGETLB
> > > is a modifier of MAP_ANONYMOUS and so must be specified with it.  The
> > > region will behave the same as a MAP_ANONYMOUS region using small pages.
> > > 
> > > Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
> > > ---
> > >  include/asm-generic/mman-common.h |    1 +
> > >  include/linux/hugetlb.h           |    7 +++++++
> > >  mm/mmap.c                         |   19 +++++++++++++++++++
> > >  3 files changed, 27 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h
> > > index 3b69ad3..12f5982 100644
> > > --- a/include/asm-generic/mman-common.h
> > > +++ b/include/asm-generic/mman-common.h
> > > @@ -19,6 +19,7 @@
> > >  #define MAP_TYPE	0x0f		/* Mask for type of mapping */
> > >  #define MAP_FIXED	0x10		/* Interpret addr exactly */
> > >  #define MAP_ANONYMOUS	0x20		/* don't use a file */
> > > +#define MAP_HUGETLB	0x40		/* create a huge page mapping */
> > >  
> > >  #define MS_ASYNC	1		/* sync memory asynchronously */
> > >  #define MS_INVALIDATE	2		/* invalidate the caches */
> > 
> > I'm afraid you can't put MAP_HUGETLB in mman-common.h: that is picked
> > up by most or all architectures (which is of course what you wanted!)
> > but conflicts with a definition in at least one of them.  When I boot
> > up mmotm on powerpc, I get a warning:
> > 
> > Using mlock ulimits for SHM_HUGETLB deprecated
> > ------------[ cut here ]------------
> > Badness at fs/hugetlbfs/inode.c:941
> > NIP: c0000000001f3038 LR: c0000000001f3034 CTR: 0000000000000000
> > REGS: c0000000275d7960 TRAP: 0700   Not tainted  (2.6.31-rc7-mm2)
> > MSR: 9000000000029032 <EE,ME,CE,IR,DR>  CR: 24000484  XER: 00000000
> > TASK = c000000029fa94a0[1321] 'console-kit-dae' THREAD: c0000000275d4000 CPU: 3
> > GPR00: c0000000001f3034 c0000000275d7be0 c00000000071a908 0000000000000032 
> > GPR04: 0000000000000000 ffffffffffffffff ffffffffffffffff 0000000000000000 
> > GPR08: c0000000297dc1d0 c0000000275d4000 d00008008247fa08 0000000000000000 
> > GPR12: 0000000024000442 c00000000074ba00 000000000fedb9a4 000000001049cd18 
> > GPR16: 00000000100365d0 00000000104a9100 000000000fefc350 00000000104a9098 
> > GPR20: 00000000104a9160 000000000fefc238 0000000000000000 0000000000200000 
> > GPR24: 0000000000000000 0000000001000000 c0000000275d7d20 0000000001000000 
> > GPR28: c00000000058c738 ffffffffffffffb5 c0000000006a93d0 c000000000791400 
> > NIP [c0000000001f3038] .hugetlb_file_setup+0xd0/0x254
> > LR [c0000000001f3034] .hugetlb_file_setup+0xcc/0x254
> > Call Trace:
> > [c0000000275d7be0] [c0000000001f3034] .hugetlb_file_setup+0xcc/0x254 (unreliable)
> > [c0000000275d7cb0] [c0000000000ee240] .do_mmap_pgoff+0x184/0x424
> > [c0000000275d7d80] [c00000000000a9c8] .sys_mmap+0xc4/0x13c
> > [c0000000275d7e30] [c0000000000075ac] syscall_exit+0x0/0x40
> > Instruction dump:
> > f89a0000 4bef7111 60000000 2c230000 41820034 e93e8018 80090014 2f800000 
> > 40fe0030 e87e80b0 4823ff09 60000000 <0fe00000> e93e8018 38000001 90090014 
> > 
> > Which won't be coming from any use of MAP_HUGETLB, but presumably
> > from something using MAP_NORESERVE, defined as 0x40 in
> > arch/powerpc/include/asm/mman.h.
> > 
> > I think you have to put your #define MAP_HUGETLB into
> > include/asm-generic/mman.h (seems used by only three architectures),
> > and into the arch/whatever/include/asm/mman.h of each architecture
> > which uses asm-generic/mman-common.h without asm-generic/mman.h.
> > 
> > Hugh
> > 
> 
> This problem is the same that Mel Gorman reported (and fixed) in response to patch
> 1 of this series.  I have forwarded the patch that addresses this problem on,
> but it has not been picked up.
> 
> The bug is not where MAP_HUGETLB is defined, rather how the patch handled
> can_do_hugetlb_shm().  If MAP_HUGETLB was specified, can_do_hugetlb_shm() returned
> 0 forcing a call to user_shm_lock() which is responisble for the warning about
> SHM_HUGETLB and mlock ulimits.  The fix is to check if the file is to be used
> for SHM_HUGETLB and if not, skip the calls to can_do_hugetlb_shm() and
> user_shm_lock().

Sorry, no, I disagree.

I agree that the fs/hugetlbfs/inode.c:941 message and backtrace in
themselves are symptoms of the can_do_hugetlb_shm() bug that Mel
reported and fixed (I'm agreeing a little too readily, I've not
actually studied that bug and fix, I'm taking it on trust).

But that does not explain how last year's openSUSE 11.1 userspace
was trying for a MAP_HUGETLB mapping at startup on PowerPC (but
not on x86), while you're only introducing MAP_HUGETLB now.

That is explained by you #defining MAP_HUGETLB in include/asm-generic/
mman-common.h to a number which is already being used for other MAP_s
on some architectures.  That's a separate bug which needs to be fixed
by distributing the MAP_HUGETLB definition across various asm*/mman.h.

Hugh

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
  2009-08-31 19:49       ` Hugh Dickins
  (?)
@ 2009-09-01  9:46       ` Eric B Munson
  2009-09-01 10:41           ` Hugh Dickins
  -1 siblings, 1 reply; 62+ messages in thread
From: Eric B Munson @ 2009-09-01  9:46 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: linux-kernel, linux-mm, akpm, linux-man, mtk.manpages, randy.dunlap

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

On Mon, 31 Aug 2009, Hugh Dickins wrote:

> On Wed, 26 Aug 2009, Eric B Munson wrote:
> > This patch adds a flag for mmap that will be used to request a huge
> > page region that will look like anonymous memory to user space.  This
> > is accomplished by using a file on the internal vfsmount.  MAP_HUGETLB
> > is a modifier of MAP_ANONYMOUS and so must be specified with it.  The
> > region will behave the same as a MAP_ANONYMOUS region using small pages.
> > 
> > Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
> > ---
> >  include/asm-generic/mman-common.h |    1 +
> >  include/linux/hugetlb.h           |    7 +++++++
> >  mm/mmap.c                         |   19 +++++++++++++++++++
> >  3 files changed, 27 insertions(+), 0 deletions(-)
> > 
> > diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h
> > index 3b69ad3..12f5982 100644
> > --- a/include/asm-generic/mman-common.h
> > +++ b/include/asm-generic/mman-common.h
> > @@ -19,6 +19,7 @@
> >  #define MAP_TYPE	0x0f		/* Mask for type of mapping */
> >  #define MAP_FIXED	0x10		/* Interpret addr exactly */
> >  #define MAP_ANONYMOUS	0x20		/* don't use a file */
> > +#define MAP_HUGETLB	0x40		/* create a huge page mapping */
> >  
> >  #define MS_ASYNC	1		/* sync memory asynchronously */
> >  #define MS_INVALIDATE	2		/* invalidate the caches */
> 
> I'm afraid you can't put MAP_HUGETLB in mman-common.h: that is picked
> up by most or all architectures (which is of course what you wanted!)
> but conflicts with a definition in at least one of them.  When I boot
> up mmotm on powerpc, I get a warning:
> 
> Using mlock ulimits for SHM_HUGETLB deprecated
> ------------[ cut here ]------------
> Badness at fs/hugetlbfs/inode.c:941
> NIP: c0000000001f3038 LR: c0000000001f3034 CTR: 0000000000000000
> REGS: c0000000275d7960 TRAP: 0700   Not tainted  (2.6.31-rc7-mm2)
> MSR: 9000000000029032 <EE,ME,CE,IR,DR>  CR: 24000484  XER: 00000000
> TASK = c000000029fa94a0[1321] 'console-kit-dae' THREAD: c0000000275d4000 CPU: 3
> GPR00: c0000000001f3034 c0000000275d7be0 c00000000071a908 0000000000000032 
> GPR04: 0000000000000000 ffffffffffffffff ffffffffffffffff 0000000000000000 
> GPR08: c0000000297dc1d0 c0000000275d4000 d00008008247fa08 0000000000000000 
> GPR12: 0000000024000442 c00000000074ba00 000000000fedb9a4 000000001049cd18 
> GPR16: 00000000100365d0 00000000104a9100 000000000fefc350 00000000104a9098 
> GPR20: 00000000104a9160 000000000fefc238 0000000000000000 0000000000200000 
> GPR24: 0000000000000000 0000000001000000 c0000000275d7d20 0000000001000000 
> GPR28: c00000000058c738 ffffffffffffffb5 c0000000006a93d0 c000000000791400 
> NIP [c0000000001f3038] .hugetlb_file_setup+0xd0/0x254
> LR [c0000000001f3034] .hugetlb_file_setup+0xcc/0x254
> Call Trace:
> [c0000000275d7be0] [c0000000001f3034] .hugetlb_file_setup+0xcc/0x254 (unreliable)
> [c0000000275d7cb0] [c0000000000ee240] .do_mmap_pgoff+0x184/0x424
> [c0000000275d7d80] [c00000000000a9c8] .sys_mmap+0xc4/0x13c
> [c0000000275d7e30] [c0000000000075ac] syscall_exit+0x0/0x40
> Instruction dump:
> f89a0000 4bef7111 60000000 2c230000 41820034 e93e8018 80090014 2f800000 
> 40fe0030 e87e80b0 4823ff09 60000000 <0fe00000> e93e8018 38000001 90090014 
> 
> Which won't be coming from any use of MAP_HUGETLB, but presumably
> from something using MAP_NORESERVE, defined as 0x40 in
> arch/powerpc/include/asm/mman.h.
> 
> I think you have to put your #define MAP_HUGETLB into
> include/asm-generic/mman.h (seems used by only three architectures),
> and into the arch/whatever/include/asm/mman.h of each architecture
> which uses asm-generic/mman-common.h without asm-generic/mman.h.
> 
> Hugh
> 

This problem is the same that Mel Gorman reported (and fixed) in response to patch
1 of this series.  I have forwarded the patch that addresses this problem on,
but it has not been picked up.

The bug is not where MAP_HUGETLB is defined, rather how the patch handled
can_do_hugetlb_shm().  If MAP_HUGETLB was specified, can_do_hugetlb_shm() returned
0 forcing a call to user_shm_lock() which is responisble for the warning about
SHM_HUGETLB and mlock ulimits.  The fix is to check if the file is to be used
for SHM_HUGETLB and if not, skip the calls to can_do_hugetlb_shm() and
user_shm_lock().

-- 
Eric B Munson
IBM Linux Technology Center
ebmunson@us.ibm.com


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
  2009-08-26 10:44   ` [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions Eric B Munson
@ 2009-08-31 19:49       ` Hugh Dickins
  0 siblings, 0 replies; 62+ messages in thread
From: Hugh Dickins @ 2009-08-31 19:49 UTC (permalink / raw)
  To: Eric B Munson
  Cc: linux-kernel, linux-mm, akpm, linux-man, mtk.manpages, randy.dunlap

On Wed, 26 Aug 2009, Eric B Munson wrote:
> This patch adds a flag for mmap that will be used to request a huge
> page region that will look like anonymous memory to user space.  This
> is accomplished by using a file on the internal vfsmount.  MAP_HUGETLB
> is a modifier of MAP_ANONYMOUS and so must be specified with it.  The
> region will behave the same as a MAP_ANONYMOUS region using small pages.
> 
> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
> ---
>  include/asm-generic/mman-common.h |    1 +
>  include/linux/hugetlb.h           |    7 +++++++
>  mm/mmap.c                         |   19 +++++++++++++++++++
>  3 files changed, 27 insertions(+), 0 deletions(-)
> 
> diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h
> index 3b69ad3..12f5982 100644
> --- a/include/asm-generic/mman-common.h
> +++ b/include/asm-generic/mman-common.h
> @@ -19,6 +19,7 @@
>  #define MAP_TYPE	0x0f		/* Mask for type of mapping */
>  #define MAP_FIXED	0x10		/* Interpret addr exactly */
>  #define MAP_ANONYMOUS	0x20		/* don't use a file */
> +#define MAP_HUGETLB	0x40		/* create a huge page mapping */
>  
>  #define MS_ASYNC	1		/* sync memory asynchronously */
>  #define MS_INVALIDATE	2		/* invalidate the caches */

I'm afraid you can't put MAP_HUGETLB in mman-common.h: that is picked
up by most or all architectures (which is of course what you wanted!)
but conflicts with a definition in at least one of them.  When I boot
up mmotm on powerpc, I get a warning:

Using mlock ulimits for SHM_HUGETLB deprecated
------------[ cut here ]------------
Badness at fs/hugetlbfs/inode.c:941
NIP: c0000000001f3038 LR: c0000000001f3034 CTR: 0000000000000000
REGS: c0000000275d7960 TRAP: 0700   Not tainted  (2.6.31-rc7-mm2)
MSR: 9000000000029032 <EE,ME,CE,IR,DR>  CR: 24000484  XER: 00000000
TASK = c000000029fa94a0[1321] 'console-kit-dae' THREAD: c0000000275d4000 CPU: 3
GPR00: c0000000001f3034 c0000000275d7be0 c00000000071a908 0000000000000032 
GPR04: 0000000000000000 ffffffffffffffff ffffffffffffffff 0000000000000000 
GPR08: c0000000297dc1d0 c0000000275d4000 d00008008247fa08 0000000000000000 
GPR12: 0000000024000442 c00000000074ba00 000000000fedb9a4 000000001049cd18 
GPR16: 00000000100365d0 00000000104a9100 000000000fefc350 00000000104a9098 
GPR20: 00000000104a9160 000000000fefc238 0000000000000000 0000000000200000 
GPR24: 0000000000000000 0000000001000000 c0000000275d7d20 0000000001000000 
GPR28: c00000000058c738 ffffffffffffffb5 c0000000006a93d0 c000000000791400 
NIP [c0000000001f3038] .hugetlb_file_setup+0xd0/0x254
LR [c0000000001f3034] .hugetlb_file_setup+0xcc/0x254
Call Trace:
[c0000000275d7be0] [c0000000001f3034] .hugetlb_file_setup+0xcc/0x254 (unreliable)
[c0000000275d7cb0] [c0000000000ee240] .do_mmap_pgoff+0x184/0x424
[c0000000275d7d80] [c00000000000a9c8] .sys_mmap+0xc4/0x13c
[c0000000275d7e30] [c0000000000075ac] syscall_exit+0x0/0x40
Instruction dump:
f89a0000 4bef7111 60000000 2c230000 41820034 e93e8018 80090014 2f800000 
40fe0030 e87e80b0 4823ff09 60000000 <0fe00000> e93e8018 38000001 90090014 

Which won't be coming from any use of MAP_HUGETLB, but presumably
from something using MAP_NORESERVE, defined as 0x40 in
arch/powerpc/include/asm/mman.h.

I think you have to put your #define MAP_HUGETLB into
include/asm-generic/mman.h (seems used by only three architectures),
and into the arch/whatever/include/asm/mman.h of each architecture
which uses asm-generic/mman-common.h without asm-generic/mman.h.

Hugh

^ permalink raw reply	[flat|nested] 62+ messages in thread

* Re: [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
@ 2009-08-31 19:49       ` Hugh Dickins
  0 siblings, 0 replies; 62+ messages in thread
From: Hugh Dickins @ 2009-08-31 19:49 UTC (permalink / raw)
  To: Eric B Munson
  Cc: linux-kernel, linux-mm, akpm, linux-man, mtk.manpages, randy.dunlap

On Wed, 26 Aug 2009, Eric B Munson wrote:
> This patch adds a flag for mmap that will be used to request a huge
> page region that will look like anonymous memory to user space.  This
> is accomplished by using a file on the internal vfsmount.  MAP_HUGETLB
> is a modifier of MAP_ANONYMOUS and so must be specified with it.  The
> region will behave the same as a MAP_ANONYMOUS region using small pages.
> 
> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
> ---
>  include/asm-generic/mman-common.h |    1 +
>  include/linux/hugetlb.h           |    7 +++++++
>  mm/mmap.c                         |   19 +++++++++++++++++++
>  3 files changed, 27 insertions(+), 0 deletions(-)
> 
> diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h
> index 3b69ad3..12f5982 100644
> --- a/include/asm-generic/mman-common.h
> +++ b/include/asm-generic/mman-common.h
> @@ -19,6 +19,7 @@
>  #define MAP_TYPE	0x0f		/* Mask for type of mapping */
>  #define MAP_FIXED	0x10		/* Interpret addr exactly */
>  #define MAP_ANONYMOUS	0x20		/* don't use a file */
> +#define MAP_HUGETLB	0x40		/* create a huge page mapping */
>  
>  #define MS_ASYNC	1		/* sync memory asynchronously */
>  #define MS_INVALIDATE	2		/* invalidate the caches */

I'm afraid you can't put MAP_HUGETLB in mman-common.h: that is picked
up by most or all architectures (which is of course what you wanted!)
but conflicts with a definition in at least one of them.  When I boot
up mmotm on powerpc, I get a warning:

Using mlock ulimits for SHM_HUGETLB deprecated
------------[ cut here ]------------
Badness at fs/hugetlbfs/inode.c:941
NIP: c0000000001f3038 LR: c0000000001f3034 CTR: 0000000000000000
REGS: c0000000275d7960 TRAP: 0700   Not tainted  (2.6.31-rc7-mm2)
MSR: 9000000000029032 <EE,ME,CE,IR,DR>  CR: 24000484  XER: 00000000
TASK = c000000029fa94a0[1321] 'console-kit-dae' THREAD: c0000000275d4000 CPU: 3
GPR00: c0000000001f3034 c0000000275d7be0 c00000000071a908 0000000000000032 
GPR04: 0000000000000000 ffffffffffffffff ffffffffffffffff 0000000000000000 
GPR08: c0000000297dc1d0 c0000000275d4000 d00008008247fa08 0000000000000000 
GPR12: 0000000024000442 c00000000074ba00 000000000fedb9a4 000000001049cd18 
GPR16: 00000000100365d0 00000000104a9100 000000000fefc350 00000000104a9098 
GPR20: 00000000104a9160 000000000fefc238 0000000000000000 0000000000200000 
GPR24: 0000000000000000 0000000001000000 c0000000275d7d20 0000000001000000 
GPR28: c00000000058c738 ffffffffffffffb5 c0000000006a93d0 c000000000791400 
NIP [c0000000001f3038] .hugetlb_file_setup+0xd0/0x254
LR [c0000000001f3034] .hugetlb_file_setup+0xcc/0x254
Call Trace:
[c0000000275d7be0] [c0000000001f3034] .hugetlb_file_setup+0xcc/0x254 (unreliable)
[c0000000275d7cb0] [c0000000000ee240] .do_mmap_pgoff+0x184/0x424
[c0000000275d7d80] [c00000000000a9c8] .sys_mmap+0xc4/0x13c
[c0000000275d7e30] [c0000000000075ac] syscall_exit+0x0/0x40
Instruction dump:
f89a0000 4bef7111 60000000 2c230000 41820034 e93e8018 80090014 2f800000 
40fe0030 e87e80b0 4823ff09 60000000 <0fe00000> e93e8018 38000001 90090014 

Which won't be coming from any use of MAP_HUGETLB, but presumably
from something using MAP_NORESERVE, defined as 0x40 in
arch/powerpc/include/asm/mman.h.

I think you have to put your #define MAP_HUGETLB into
include/asm-generic/mman.h (seems used by only three architectures),
and into the arch/whatever/include/asm/mman.h of each architecture
which uses asm-generic/mman-common.h without asm-generic/mman.h.

Hugh

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

^ permalink raw reply	[flat|nested] 62+ messages in thread

* [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions
  2009-08-26 10:44 ` [PATCH 1/3] hugetlbfs: Allow the creation of files suitable for MAP_PRIVATE on the vfs internal mount Eric B Munson
@ 2009-08-26 10:44   ` Eric B Munson
  2009-08-31 19:49       ` Hugh Dickins
  0 siblings, 1 reply; 62+ messages in thread
From: Eric B Munson @ 2009-08-26 10:44 UTC (permalink / raw)
  To: linux-kernel, linux-mm, akpm
  Cc: linux-man, mtk.manpages, randy.dunlap, Eric B Munson

This patch adds a flag for mmap that will be used to request a huge
page region that will look like anonymous memory to user space.  This
is accomplished by using a file on the internal vfsmount.  MAP_HUGETLB
is a modifier of MAP_ANONYMOUS and so must be specified with it.  The
region will behave the same as a MAP_ANONYMOUS region using small pages.

Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
---
 include/asm-generic/mman-common.h |    1 +
 include/linux/hugetlb.h           |    7 +++++++
 mm/mmap.c                         |   19 +++++++++++++++++++
 3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h
index 3b69ad3..12f5982 100644
--- a/include/asm-generic/mman-common.h
+++ b/include/asm-generic/mman-common.h
@@ -19,6 +19,7 @@
 #define MAP_TYPE	0x0f		/* Mask for type of mapping */
 #define MAP_FIXED	0x10		/* Interpret addr exactly */
 #define MAP_ANONYMOUS	0x20		/* don't use a file */
+#define MAP_HUGETLB	0x40		/* create a huge page mapping */
 
 #define MS_ASYNC	1		/* sync memory asynchronously */
 #define MS_INVALIDATE	2		/* invalidate the caches */
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 38bb552..b0bc0fd 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -110,12 +110,19 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
 
 #endif /* !CONFIG_HUGETLB_PAGE */
 
+#define HUGETLB_ANON_FILE "anon_hugepage"
+
 enum {
 	/*
 	 * The file will be used as an shm file so shmfs accounting rules
 	 * apply
 	 */
 	HUGETLB_SHMFS_INODE     = 1,
+	/*
+	 * The file is being created on the internal vfs mount and shmfs
+	 * accounting rules do not apply
+	 */
+	HUGETLB_ANONHUGE_INODE  = 2,
 };
 
 #ifdef CONFIG_HUGETLBFS
diff --git a/mm/mmap.c b/mm/mmap.c
index 8101de4..9ca4f26 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -29,6 +29,7 @@
 #include <linux/rmap.h>
 #include <linux/mmu_notifier.h>
 #include <linux/perf_counter.h>
+#include <linux/hugetlb.h>
 
 #include <asm/uaccess.h>
 #include <asm/cacheflush.h>
@@ -951,6 +952,24 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
 	if (mm->map_count > sysctl_max_map_count)
 		return -ENOMEM;
 
+	if (flags & MAP_HUGETLB) {
+		struct user_struct *user = NULL;
+		if (file)
+			return -EINVAL;
+
+		/*
+		 * VM_NORESERVE is used because the reservations will be
+		 * taken when vm_ops->mmap() is called
+		 * A dummy user value is used because we are not locking
+		 * memory so no accounting is necessary
+		 */
+		len = ALIGN(len, huge_page_size(&default_hstate));
+		file = hugetlb_file_setup(HUGETLB_ANON_FILE, len, VM_NORESERVE,
+						&user, HUGETLB_ANONHUGE_INODE);
+		if (IS_ERR(file))
+			return PTR_ERR(file);
+	}
+
 	/* Obtain the address to map to. we verify (or select) it and ensure
 	 * that it represents a valid section of the address space.
 	 */
-- 
1.6.3.2

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

^ permalink raw reply related	[flat|nested] 62+ messages in thread

end of thread, other threads:[~2009-09-21 23:59 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-25 11:14 [PATCH 0/3] Add pseudo-anonymous huge page mappings V4 Eric B Munson
2009-08-25 11:14 ` [PATCH 1/3] hugetlbfs: Allow the creation of files suitable for MAP_PRIVATE on the vfs internal mount Eric B Munson
2009-08-25 11:14   ` [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions Eric B Munson
2009-08-25 11:14     ` [PATCH 3/3] Add MAP_HUGETLB example Eric B Munson
2009-09-17 22:44     ` [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions Andrew Morton
2009-09-17 22:44       ` Andrew Morton
2009-09-17 22:44       ` Andrew Morton
2009-09-18  0:46       ` Andrew Morton
2009-09-18  0:46         ` Andrew Morton
2009-09-18  0:46         ` Andrew Morton
2009-09-18 15:19         ` [PATCH] " Arnd Bergmann
2009-09-18 15:19           ` Arnd Bergmann
2009-09-18 16:48           ` [PATCH] remove duplicate asm/mman.h files Arnd Bergmann
2009-09-18 16:48             ` Arnd Bergmann
2009-09-18 16:48             ` Arnd Bergmann
2009-09-18 19:37             ` David Rientjes
2009-09-18 19:37               ` David Rientjes
2009-09-18 19:37               ` David Rientjes
2009-09-21  8:31               ` Arnd Bergmann
2009-09-21  8:31                 ` Arnd Bergmann
2009-09-21  8:31                 ` Arnd Bergmann
2009-09-21  9:13                 ` David Rientjes
2009-09-21  9:13                   ` David Rientjes
2009-09-21  9:13                   ` David Rientjes
2009-09-21  9:30                   ` Arnd Bergmann
2009-09-21  9:30                     ` Arnd Bergmann
2009-09-21  9:30                     ` Arnd Bergmann
2009-09-21 12:02                   ` Hugh Dickins
2009-09-21 12:02                     ` Hugh Dickins
2009-09-21 12:02                     ` Hugh Dickins
2009-09-21 12:02                     ` Hugh Dickins
2009-09-21 22:55                     ` David Rientjes
2009-09-21 22:55                       ` David Rientjes
2009-09-21 22:55                       ` David Rientjes
2009-09-21 23:25                       ` Luck, Tony
2009-09-21 23:25                         ` Luck, Tony
2009-09-21 23:25                         ` Luck, Tony
2009-09-21 23:46                         ` David Rientjes
2009-09-21 23:46                           ` David Rientjes
2009-09-21 23:46                           ` David Rientjes
2009-09-21 23:58                           ` Ulrich Drepper
2009-09-21 23:58                             ` Ulrich Drepper
2009-09-21 23:58                             ` Ulrich Drepper
2009-09-21 23:58                             ` Ulrich Drepper
2009-09-21 12:27             ` Eric B Munson
2009-09-21 12:25           ` [PATCH] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions Eric B Munson
2009-08-26 19:34   ` [PATCH 1/3] hugetlbfs: Allow the creation of files suitable for MAP_PRIVATE on the vfs internal mount David Rientjes
2009-08-26 19:34     ` David Rientjes
2009-08-26 10:44 [PATCH 0/3] Add pseudo-anonymous huge page mappings V4 Eric B Munson
2009-08-26 10:44 ` [PATCH 1/3] hugetlbfs: Allow the creation of files suitable for MAP_PRIVATE on the vfs internal mount Eric B Munson
2009-08-26 10:44   ` [PATCH 2/3] Add MAP_HUGETLB for mmaping pseudo-anonymous huge page regions Eric B Munson
2009-08-31 19:49     ` Hugh Dickins
2009-08-31 19:49       ` Hugh Dickins
2009-09-01  9:46       ` Eric B Munson
2009-09-01 10:41         ` Hugh Dickins
2009-09-01 10:41           ` Hugh Dickins
2009-09-01 10:41           ` Hugh Dickins
2009-09-01 13:08           ` Eric B Munson
2009-09-01 13:34             ` Hugh Dickins
2009-09-01 13:34               ` Hugh Dickins
2009-09-01 13:34               ` Hugh Dickins
2009-09-02  8:34               ` Arnd Bergmann
2009-09-02  8:34                 ` Arnd Bergmann
2009-09-02  8:34                 ` Arnd Bergmann

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.