On Wed, May 12, 2010 at 01:39:58PM -0400, Rik van Riel wrote:Subject: 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.
Shouldn't this be "usually the last one that gets freed" because of the
ref-counting by KSM aspect? Minor nit anyway.
Signed-off-by: Rik van Riel<riel@xxxxxxxxxx>
Otherwise
Acked-by: Mel Gorman<mel@xxxxxxxxx>