Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250897
b: refs/heads/master
c: 6111e4c
h: refs/heads/master
i:
  250895: 3e161ab
v: v3
  • Loading branch information
Peter Zijlstra authored and Linus Torvalds committed May 25, 2011
1 parent 3e5d67d commit 38e1844
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 25aeeb046e695c3093a86aa9386128ffb3b1bc32
refs/heads/master: 6111e4ca6829a0e8b092b8e5eeb6b5366091f29c
18 changes: 16 additions & 2 deletions trunk/mm/rmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,22 @@ void __init anon_vma_init(void)
}

/*
* Getting a lock on a stable anon_vma from a page off the LRU is
* tricky: page_lock_anon_vma rely on RCU to guard against the races.
* Getting a lock on a stable anon_vma from a page off the LRU is tricky!
*
* Since there is no serialization what so ever against page_remove_rmap()
* the best this function can do is return a locked anon_vma that might
* have been relevant to this page.
*
* The page might have been remapped to a different anon_vma or the anon_vma
* returned may already be freed (and even reused).
*
* All users of this function must be very careful when walking the anon_vma
* chain and verify that the page in question is indeed mapped in it
* [ something equivalent to page_mapped_in_vma() ].
*
* Since anon_vma's slab is DESTROY_BY_RCU and we know from page_remove_rmap()
* that the anon_vma pointer from page->mapping is valid if there is a
* mapcount, we can dereference the anon_vma after observing those.
*/
struct anon_vma *page_lock_anon_vma(struct page *page)
{
Expand Down

0 comments on commit 38e1844

Please sign in to comment.