diff options
author | Namhyung Kim <namhyung@gmail.com> | 2010-10-26 17:22:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-26 19:52:09 -0400 |
commit | ea4525b6008fb29553306ec6719f8e6930ac9499 (patch) | |
tree | 1d168e0a05a5f2fc962b8a6e991a21b704ad6e0b /include/linux | |
parent | 1b36ba815bd91f17e31277a44dd5c6b6a5a8d97e (diff) |
rmap: annotate lock context change on page_[un]lock_anon_vma()
The page_lock_anon_vma() conditionally grabs RCU and anon_vma lock but
page_unlock_anon_vma() releases them unconditionally. This leads sparse
to complain about context imbalance. Annotate them.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/rmap.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 5c98df68a953..07ea89c16761 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -230,7 +230,20 @@ int try_to_munlock(struct page *); | |||
230 | /* | 230 | /* |
231 | * Called by memory-failure.c to kill processes. | 231 | * Called by memory-failure.c to kill processes. |
232 | */ | 232 | */ |
233 | struct anon_vma *page_lock_anon_vma(struct page *page); | 233 | struct anon_vma *__page_lock_anon_vma(struct page *page); |
234 | |||
235 | static inline struct anon_vma *page_lock_anon_vma(struct page *page) | ||
236 | { | ||
237 | struct anon_vma *anon_vma; | ||
238 | |||
239 | __cond_lock(RCU, anon_vma = __page_lock_anon_vma(page)); | ||
240 | |||
241 | /* (void) is needed to make gcc happy */ | ||
242 | (void) __cond_lock(&anon_vma->root->lock, anon_vma); | ||
243 | |||
244 | return anon_vma; | ||
245 | } | ||
246 | |||
234 | void page_unlock_anon_vma(struct anon_vma *anon_vma); | 247 | void page_unlock_anon_vma(struct anon_vma *anon_vma); |
235 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); | 248 | int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); |
236 | 249 | ||