From: Michal Hocko <mhocko@suse.cz>
Subject: kabi, mm: prevent endless growth of anon_vma hierarchy
Patch-mainline: never, kabi fixup
References: bnc#904242

anon_vma should not be allocated outside of the rmap code so adding
new fields at the end of the structure should be safe.

Signed-off-by: Michal Hocko <mhocko@suse.cz>

---
 include/linux/rmap.h |   22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -37,16 +37,6 @@ struct anon_vma {
 	atomic_t refcount;
 
 	/*
-	 * Count of child anon_vmas and VMAs which points to this anon_vma.
-	 *
-	 * This counter is used for making decision about reusing anon_vma
-	 * instead of forking new one. See comments in function anon_vma_clone.
-	 */
-	unsigned degree;
-
-	struct anon_vma *parent;	/* Parent of this anon_vma */
-
-	/*
 	 * NOTE: the LSB of the rb_root.rb_node is set by
 	 * mm_take_all_locks() _after_ taking the above lock. So the
 	 * rb_root must only be read/written after taking the above lock
@@ -55,6 +45,18 @@ struct anon_vma {
 	 * mm_take_all_locks() (mm_all_locks_mutex).
 	 */
 	struct rb_root rb_root;	/* Interval tree of private "related" vmas */
+
+#ifndef __GENKSYMS__
+	/*
+	 * Count of child anon_vmas and VMAs which points to this anon_vma.
+	 *
+	 * This counter is used for making decision about reusing anon_vma
+	 * instead of forking new one. See comments in function anon_vma_clone.
+	 */
+	unsigned degree;
+
+	struct anon_vma *parent;	/* Parent of this anon_vma */
+#endif
 };
 
 /*
