summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMinchan Kim <minchan@kernel.org>2013-07-25 13:44:32 +0900
committerMyungJoo Ham <myungjoo.ham@samsung.com>2013-11-15 13:52:27 +0900
commit30cf4af092fb003edd9c5f6ac87900838deb6f01 (patch)
tree07832acd714a2f6742be337465d0ab4536ebd4fc /include
parentf1f160881562a0a9bc509cab80af79bad4903476 (diff)
downloadlinux-3.10-30cf4af092fb003edd9c5f6ac87900838deb6f01.tar.gz
linux-3.10-30cf4af092fb003edd9c5f6ac87900838deb6f01.tar.bz2
linux-3.10-30cf4af092fb003edd9c5f6ac87900838deb6f01.zip
vrange: Add vrange support to mm_structs
This patch addes vroot on mm_struct so process can have volatile ranges on anonymous memory. This is somewhat wasteful, as it increases the mm struct even if the process doesn't use vrange syscall. So an following patch will make it dynamically allocated. One of note on this patch is vrange_fork. Its could deadlock with direct reclaim's purging logic due to vrange_lock so vrange_fork uses GFP_NOIO. It does make sense because purging is kind of I/O operation although it doesn't do anything related to I/O issuing and it could be very understandable when I will introduce vrange-file, which should avoid direct purging when caller pass GFP_FS to avoid deadlock. If vrange_fork fails, it isn't critical because worst case from user POV is that pages in vrange of parent can't be purged, which is likely better than having fork fail. Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Android Kernel Team <kernel-team@android.com> Cc: Robert Love <rlove@google.com> Cc: Mel Gorman <mel@csn.ul.ie> Cc: Hugh Dickins <hughd@google.com> Cc: Dave Hansen <dave@linux.vnet.ibm.com> Cc: Rik van Riel <riel@redhat.com> Cc: Dmitry Adamushko <dmitry.adamushko@gmail.com> Cc: Dave Chinner <david@fromorbit.com> Cc: Neil Brown <neilb@suse.de> Cc: Andrea Righi <andrea@betterlinux.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: Mike Hommey <mh@glandium.org> Cc: Taras Glek <tglek@mozilla.com> Cc: Dhaval Giani <dgiani@mozilla.com> Cc: Jan Kara <jack@suse.cz> Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com> Cc: Michel Lespinasse <walken@google.com> Cc: Minchan Kim <minchan@kernel.org> Cc: linux-mm@kvack.org <linux-mm@kvack.org> Signed-off-by: Minchan Kim <minchan@kernel.org> [jstultz: Bit of refactoring. Comment cleanups] Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mm_types.h4
-rw-r--r--include/linux/vrange.h7
2 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 4a189ba6b12..7e14abdada7 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -13,6 +13,7 @@
#include <linux/page-debug-flags.h>
#include <linux/uprobes.h>
#include <linux/page-flags-layout.h>
+#include <linux/vrange_types.h>
#include <asm/page.h>
#include <asm/mmu.h>
@@ -352,6 +353,9 @@ struct mm_struct {
*/
+#ifdef CONFIG_MMU
+ struct vrange_root vroot;
+#endif
unsigned long hiwater_rss; /* High-watermark of RSS usage */
unsigned long hiwater_vm; /* High-water virtual memory usage */
diff --git a/include/linux/vrange.h b/include/linux/vrange.h
index 27d4c2e3c98..fc0baf6c613 100644
--- a/include/linux/vrange.h
+++ b/include/linux/vrange.h
@@ -35,11 +35,16 @@ static inline int vrange_type(struct vrange *vrange)
}
extern void vrange_root_cleanup(struct vrange_root *vroot);
-
+extern int vrange_fork(struct mm_struct *new,
+ struct mm_struct *old);
#else
static inline void vrange_root_init(struct vrange_root *vroot, int type) {};
static inline void vrange_root_cleanup(struct vrange_root *vroot) {};
+static inline int vrange_fork(struct mm_struct *new, struct mm_struct *old)
+{
+ return 0;
+}
#endif
#endif /* _LINIUX_VRANGE_H */