All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konstantin Khlebnikov <khlebnikov@openvz.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, Hugh Dickins <hughd@google.com>,
	linux-kernel@vger.kernel.org,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: [PATCH 01/16] mm: introduce NR_VMA_FLAGS
Date: Wed, 21 Mar 2012 10:56:16 +0400	[thread overview]
Message-ID: <20120321065616.13852.56502.stgit@zurg> (raw)
In-Reply-To: <20120321065140.13852.52315.stgit@zurg>

This patch adds NR_VMA_FLAGS constant into generated/bounds.h
and switch type of vm_flags_t depending on it.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Hugh Dickins <hughd@google.com>
---
 include/linux/mm.h       |    8 ++++++++
 include/linux/mm_types.h |    5 +++++
 kernel/bounds.c          |    2 ++
 3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 5b29b4f..69915a2 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -4,6 +4,7 @@
 #include <linux/errno.h>
 
 #ifdef __KERNEL__
+#ifndef __GENERATING_BOUNDS_H
 
 #include <linux/gfp.h>
 #include <linux/bug.h>
@@ -67,6 +68,8 @@ extern struct rw_semaphore nommu_region_sem;
 extern unsigned int kobjsize(const void *objp);
 #endif
 
+#endif /* __GENERATING_BOUNDS_H */
+
 /*
  * vm_flags in vm_area_struct, see mm_types.h.
  */
@@ -120,6 +123,10 @@ extern unsigned int kobjsize(const void *objp);
 #define VM_PFN_AT_MMAP	0x40000000	/* PFNMAP vma that is fully mapped at mmap time */
 #define VM_MERGEABLE	0x80000000	/* KSM may merge identical pages */
 
+#define __NR_VMA_FLAGS	32
+
+#ifndef __GENERATING_BOUNDS_H
+
 /* Bits set in the VMA until the stack is in its final location */
 #define VM_STACK_INCOMPLETE_SETUP	(VM_RAND_READ | VM_SEQ_READ)
 
@@ -1642,5 +1649,6 @@ static inline unsigned int debug_guardpage_minorder(void) { return 0; }
 static inline bool page_is_guard(struct page *page) { return false; }
 #endif /* CONFIG_DEBUG_PAGEALLOC */
 
+#endif /* __GENERATING_BOUNDS_H */
 #endif /* __KERNEL__ */
 #endif /* _LINUX_MM_H */
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 76bbdaf..3aeb8f6 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -12,6 +12,7 @@
 #include <linux/completion.h>
 #include <linux/cpumask.h>
 #include <linux/page-debug-flags.h>
+#include <generated/bounds.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
 
@@ -170,7 +171,11 @@ struct page_frag {
 #endif
 };
 
+#if (NR_VMA_FLAGS > 32)
+typedef unsigned long long __nocast vm_flags_t;
+#else
 typedef unsigned long __nocast vm_flags_t;
+#endif
 
 /*
  * A region containing a mapping of a non-memory backed file under NOMMU
diff --git a/kernel/bounds.c b/kernel/bounds.c
index 0c9b862..6d2732f 100644
--- a/kernel/bounds.c
+++ b/kernel/bounds.c
@@ -7,6 +7,7 @@
 #define __GENERATING_BOUNDS_H
 /* Include headers that define the enum constants of interest */
 #include <linux/page-flags.h>
+#include <linux/mm.h>
 #include <linux/mmzone.h>
 #include <linux/kbuild.h>
 #include <linux/page_cgroup.h>
@@ -15,6 +16,7 @@ void foo(void)
 {
 	/* The enum constants to put into include/generated/bounds.h */
 	DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);
+	DEFINE(NR_VMA_FLAGS, __NR_VMA_FLAGS);
 	DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES);
 	DEFINE(NR_PCG_FLAGS, __NR_PCG_FLAGS);
 	/* End of constants */

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Konstantin Khlebnikov <khlebnikov@openvz.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, Hugh Dickins <hughd@google.com>,
	linux-kernel@vger.kernel.org,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: [PATCH 01/16] mm: introduce NR_VMA_FLAGS
Date: Wed, 21 Mar 2012 10:56:16 +0400	[thread overview]
Message-ID: <20120321065616.13852.56502.stgit@zurg> (raw)
In-Reply-To: <20120321065140.13852.52315.stgit@zurg>

This patch adds NR_VMA_FLAGS constant into generated/bounds.h
and switch type of vm_flags_t depending on it.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Hugh Dickins <hughd@google.com>
---
 include/linux/mm.h       |    8 ++++++++
 include/linux/mm_types.h |    5 +++++
 kernel/bounds.c          |    2 ++
 3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 5b29b4f..69915a2 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -4,6 +4,7 @@
 #include <linux/errno.h>
 
 #ifdef __KERNEL__
+#ifndef __GENERATING_BOUNDS_H
 
 #include <linux/gfp.h>
 #include <linux/bug.h>
@@ -67,6 +68,8 @@ extern struct rw_semaphore nommu_region_sem;
 extern unsigned int kobjsize(const void *objp);
 #endif
 
+#endif /* __GENERATING_BOUNDS_H */
+
 /*
  * vm_flags in vm_area_struct, see mm_types.h.
  */
@@ -120,6 +123,10 @@ extern unsigned int kobjsize(const void *objp);
 #define VM_PFN_AT_MMAP	0x40000000	/* PFNMAP vma that is fully mapped at mmap time */
 #define VM_MERGEABLE	0x80000000	/* KSM may merge identical pages */
 
+#define __NR_VMA_FLAGS	32
+
+#ifndef __GENERATING_BOUNDS_H
+
 /* Bits set in the VMA until the stack is in its final location */
 #define VM_STACK_INCOMPLETE_SETUP	(VM_RAND_READ | VM_SEQ_READ)
 
@@ -1642,5 +1649,6 @@ static inline unsigned int debug_guardpage_minorder(void) { return 0; }
 static inline bool page_is_guard(struct page *page) { return false; }
 #endif /* CONFIG_DEBUG_PAGEALLOC */
 
+#endif /* __GENERATING_BOUNDS_H */
 #endif /* __KERNEL__ */
 #endif /* _LINUX_MM_H */
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 76bbdaf..3aeb8f6 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -12,6 +12,7 @@
 #include <linux/completion.h>
 #include <linux/cpumask.h>
 #include <linux/page-debug-flags.h>
+#include <generated/bounds.h>
 #include <asm/page.h>
 #include <asm/mmu.h>
 
@@ -170,7 +171,11 @@ struct page_frag {
 #endif
 };
 
+#if (NR_VMA_FLAGS > 32)
+typedef unsigned long long __nocast vm_flags_t;
+#else
 typedef unsigned long __nocast vm_flags_t;
+#endif
 
 /*
  * A region containing a mapping of a non-memory backed file under NOMMU
diff --git a/kernel/bounds.c b/kernel/bounds.c
index 0c9b862..6d2732f 100644
--- a/kernel/bounds.c
+++ b/kernel/bounds.c
@@ -7,6 +7,7 @@
 #define __GENERATING_BOUNDS_H
 /* Include headers that define the enum constants of interest */
 #include <linux/page-flags.h>
+#include <linux/mm.h>
 #include <linux/mmzone.h>
 #include <linux/kbuild.h>
 #include <linux/page_cgroup.h>
@@ -15,6 +16,7 @@ void foo(void)
 {
 	/* The enum constants to put into include/generated/bounds.h */
 	DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);
+	DEFINE(NR_VMA_FLAGS, __NR_VMA_FLAGS);
 	DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES);
 	DEFINE(NR_PCG_FLAGS, __NR_PCG_FLAGS);
 	/* End of constants */


  reply	other threads:[~2012-03-21  6:56 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-21  6:56 [PATCH 00/16] mm: prepare for converting vm->vm_flags to 64-bit Konstantin Khlebnikov
2012-03-21  6:56 ` Konstantin Khlebnikov
2012-03-21  6:56 ` Konstantin Khlebnikov [this message]
2012-03-21  6:56   ` [PATCH 01/16] mm: introduce NR_VMA_FLAGS Konstantin Khlebnikov
2012-03-21  6:56 ` [PATCH 02/16] mm: use vm_flags_t for vma flags Konstantin Khlebnikov
2012-03-21  6:56   ` Konstantin Khlebnikov
2012-03-21  6:56 ` [PATCH 03/16] mm/shmem: " Konstantin Khlebnikov
2012-03-21  6:56   ` Konstantin Khlebnikov
2012-03-21  6:56 ` [PATCH 04/16] mm/nommu: " Konstantin Khlebnikov
2012-03-21  6:56   ` Konstantin Khlebnikov
2012-03-21  7:08   ` Greg Ungerer
2012-03-21  7:08     ` Greg Ungerer
2012-03-21  7:20     ` Konstantin Khlebnikov
2012-03-21  7:20       ` Konstantin Khlebnikov
2012-03-21 12:01   ` [PATCH v2 " Konstantin Khlebnikov
2012-03-21 12:01     ` Konstantin Khlebnikov
2012-03-23  6:47     ` Greg Ungerer
2012-03-23  6:47       ` Greg Ungerer
2012-03-21  6:56 ` [PATCH 05/16] mm/drivers: " Konstantin Khlebnikov
2012-03-21  6:56   ` Konstantin Khlebnikov
2012-03-21 10:34   ` Laurent Pinchart
2012-03-21 10:34     ` Laurent Pinchart
2012-03-21 14:46   ` Greg Kroah-Hartman
2012-03-21 14:46     ` Greg Kroah-Hartman
2012-03-21  6:56 ` [PATCH 06/16] mm/x86: " Konstantin Khlebnikov
2012-03-21  6:56   ` Konstantin Khlebnikov
2012-03-21  6:57   ` H. Peter Anvin
2012-03-21  6:57     ` H. Peter Anvin
2012-03-21  6:56 ` [PATCH 07/16] mm/arm: " Konstantin Khlebnikov
2012-03-21  6:56   ` Konstantin Khlebnikov
2012-03-21  6:56   ` Konstantin Khlebnikov
2012-03-22 21:21   ` Andrew Morton
2012-03-22 21:21     ` Andrew Morton
2012-03-22 21:21     ` Andrew Morton
2012-03-21  6:56 ` [PATCH 08/16] mm/unicore32: " Konstantin Khlebnikov
2012-03-21  6:56   ` Konstantin Khlebnikov
2012-03-27  3:38   ` Guan Xuetao
2012-03-27  3:38     ` Guan Xuetao
2012-03-27  5:58     ` Konstantin Khlebnikov
2012-03-27  5:58       ` Konstantin Khlebnikov
2012-03-27  7:50       ` Guan Xuetao
2012-03-27  7:50         ` Guan Xuetao
2012-03-21  6:56 ` [PATCH 09/16] mm/ia64: " Konstantin Khlebnikov
2012-03-21  6:56   ` Konstantin Khlebnikov
2012-03-21  6:56   ` Konstantin Khlebnikov
2012-03-21  6:56 ` [PATCH 10/16] mm/powerpc: " Konstantin Khlebnikov
2012-03-21  6:56   ` Konstantin Khlebnikov
2012-03-21  6:56   ` Konstantin Khlebnikov
2012-03-21  6:56 ` [PATCH 11/16] mm/s390: " Konstantin Khlebnikov
2012-03-21  6:56   ` Konstantin Khlebnikov
2012-03-21  6:57 ` [PATCH 12/16] mm/mips: " Konstantin Khlebnikov
2012-03-21  6:57   ` Konstantin Khlebnikov
2012-03-21  6:57 ` [PATCH 13/16] mm/parisc: " Konstantin Khlebnikov
2012-03-21  6:57   ` Konstantin Khlebnikov
2012-03-21  6:57 ` [PATCH 14/16] mm/score: " Konstantin Khlebnikov
2012-03-21  6:57   ` Konstantin Khlebnikov
2012-03-21  6:57 ` [PATCH 15/16] mm: cast vm_flags_t to u64 before printing Konstantin Khlebnikov
2012-03-21  6:57   ` Konstantin Khlebnikov
2012-03-21  6:57 ` [PATCH 16/16] mm: vm_flags_t strict type checking Konstantin Khlebnikov
2012-03-21  6:57   ` Konstantin Khlebnikov
2012-03-21 12:11   ` [PATCH v2 " Konstantin Khlebnikov
2012-03-21 12:11     ` Konstantin Khlebnikov
2012-03-21 10:06 ` [PATCH 00/16] mm: prepare for converting vm->vm_flags to 64-bit Minchan Kim
2012-03-21 10:06   ` Minchan Kim
2012-03-21 13:16   ` Konstantin Khlebnikov
2012-03-21 13:16     ` Konstantin Khlebnikov
2012-03-22  5:39     ` Minchan Kim
2012-03-22  5:39       ` Minchan Kim
2012-03-22  6:22       ` Benjamin Herrenschmidt
2012-03-22  6:22         ` Benjamin Herrenschmidt
2012-03-24 14:46         ` Konstantin Khlebnikov
2012-03-24 14:46           ` Konstantin Khlebnikov
2012-03-24 15:00           ` Konstantin Khlebnikov
2012-03-24 15:00             ` Konstantin Khlebnikov
2012-03-24 23:50           ` Benjamin Herrenschmidt
2012-03-24 23:50             ` Benjamin Herrenschmidt
2012-03-25  7:55             ` Konstantin Khlebnikov
2012-03-25  7:55               ` Konstantin Khlebnikov
2012-03-22 21:26     ` Andrew Morton
2012-03-22 21:26       ` Andrew Morton
2012-03-22 21:28       ` Al Viro
2012-03-22 21:28         ` Al Viro
2012-03-22 21:41         ` Andrew Morton
2012-03-22 21:41           ` Andrew Morton
2012-03-22 21:57           ` Al Viro
2012-03-22 21:57             ` Al Viro
2012-03-22 22:05           ` Konstantin Khlebnikov
2012-03-22 22:05             ` Konstantin Khlebnikov
2012-03-22 22:24             ` Konstantin Khlebnikov
2012-03-22 22:24               ` Konstantin Khlebnikov
2012-03-22 22:39               ` Linus Torvalds
2012-03-22 22:39                 ` Linus Torvalds
2012-03-22 22:52                 ` Konstantin Khlebnikov
2012-03-22 22:52                   ` Konstantin Khlebnikov
2012-03-22 23:09                   ` Andrew Morton
2012-03-22 23:09                     ` Andrew Morton
2012-03-23  1:42                     ` Al Viro
2012-03-23  1:42                       ` Al Viro
2012-03-22 22:08           ` Linus Torvalds
2012-03-22 22:08             ` Linus Torvalds
2012-03-23 16:19         ` KOSAKI Motohiro
2012-03-23 16:19           ` KOSAKI Motohiro
2012-03-30  2:19           ` Al Viro
2012-03-30  2:19             ` Al Viro

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20120321065616.13852.56502.stgit@zurg \
    --to=khlebnikov@openvz.org \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=hughd@google.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is 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.