Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm, rmap: Add yet more comments to page_get_anon_vma/page_lock_anon_vma

Inspired by an analysis from Hugh on why again all this doesn't explode
in our face.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Peter Zijlstra and committed by
Linus Torvalds
bc658c96 139f37f5

+6 -1
+6 -1
mm/rmap.c
··· 352 352 * The page might have been remapped to a different anon_vma or the anon_vma 353 353 * returned may already be freed (and even reused). 354 354 * 355 + * In case it was remapped to a different anon_vma, the new anon_vma will be a 356 + * child of the old anon_vma, and the anon_vma lifetime rules will therefore 357 + * ensure that any anon_vma obtained from the page will still be valid for as 358 + * long as we observe page_mapped() [ hence all those page_mapped() tests ]. 359 + * 355 360 * All users of this function must be very careful when walking the anon_vma 356 361 * chain and verify that the page in question is indeed mapped in it 357 362 * [ something equivalent to page_mapped_in_vma() ]. ··· 426 421 /* 427 422 * If the page is still mapped, then this anon_vma is still 428 423 * its anon_vma, and holding the mutex ensures that it will 429 - * not go away, see __put_anon_vma(). 424 + * not go away, see anon_vma_free(). 430 425 */ 431 426 if (!page_mapped(page)) { 432 427 mutex_unlock(&root_anon_vma->mutex);