aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRik van Riel <riel@redhat.com>2010-08-09 20:18:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-09 23:44:55 -0400
commit5c341ee1dfc8fe69d66b1c8b19e463c6d7201ae1 (patch)
tree41f05611f8b1d7562c2193ade8c089408f262a6b /include
parentcba48b98f2348c814316c4b4f411a07a0e4a2bf9 (diff)
mm: track the root (oldest) anon_vma
Track the root (oldest) anon_vma in each anon_vma tree. Because we only take the lock on the root anon_vma, we cannot use the lock on higher-up anon_vmas to lock anything. This makes it impossible to do an indirect lookup of the root anon_vma, since the data structures could go away from under us. However, a direct pointer is safe because the root anon_vma is always the last one that gets freed on munmap or exit, by virtue of the same_vma list order and unlink_anon_vmas walking the list forward. [akpm@linux-foundation.org: fix typo] Signed-off-by: Rik van Riel <riel@redhat.com> Acked-by: Mel Gorman <mel@csn.ul.ie> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Tested-by: Larry Woodman <lwoodman@redhat.com> Acked-by: Larry Woodman <lwoodman@redhat.com> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/rmap.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 5f981be61416..41fa6ddc6214 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -26,6 +26,7 @@
26 */ 26 */
27struct anon_vma { 27struct anon_vma {
28 spinlock_t lock; /* Serialize access to vma list */ 28 spinlock_t lock; /* Serialize access to vma list */
29 struct anon_vma *root; /* Root of this anon_vma tree */
29#if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION) 30#if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION)
30 31
31 /* 32 /*