]> Git Repo - linux.git/commit
Simplify and comment on anon_vma re-use for anon_vma_prepare()
authorLinus Torvalds <[email protected]>
Sat, 10 Apr 2010 17:36:19 +0000 (10:36 -0700)
committerLinus Torvalds <[email protected]>
Tue, 13 Apr 2010 00:53:59 +0000 (17:53 -0700)
commitd0e9fe1758f222f13ec893f856552d81a10d266d
tree93e55a2e26c2b2f40b6d9142515fd14de8eb6647
parent0eddb519b9127c73d53db4bf3ec1d45b13f844d1
Simplify and comment on anon_vma re-use for anon_vma_prepare()

This changes the anon_vma reuse case to require that we only reuse
simple anon_vma's - ie the case when the vma only has a single anon_vma
associated with it.

This means that a reuse of an anon_vma from an adjacent vma will always
guarantee that both vma's are associated not only with the same
anon_vma, they will also have the same anon_vma chain (of just a single
entry in this case).

And since anon_vma re-use was the only case where the same anon_vma
might be associated with different chains of anon_vma's, we now have the
case that every vma that shares the same anon_vma will always also have
the same chain.  That makes it much easier to think about merging vma's
that share the same anon_vma's: you can always just drop the other
anon_vma chain in anon_vma_merge() since you know that they are always
identical.

This also splits up the function to validate the anon_vma re-use, and
adds a lot of commentary about the possible races.

Reviewed-by: Rik van Riel <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Tested-by: Borislav Petkov <[email protected]> [ "That didn't fix it" ]
Signed-off-by: Linus Torvalds <[email protected]>
mm/mmap.c
This page took 0.06958 seconds and 4 git commands to generate.