aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2008-09-10 07:37:17 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-11 03:44:21 -0400
commit3ee1afa308f2a38e5d1e2ad3752ad7abcf480da1 (patch)
tree914e0f3bbd32a387cf6095c6955369fa8da7ebf6 /mm
parentc10d38dda1774ed4540380333cabd229eff37094 (diff)
x86: some lock annotations for user copy paths, v2
- introduce might_fault() - handle the atomic user copy paths correctly [ mingo@elte.hu: move might_sleep() outside of in_atomic(). ] Signed-off-by: Nick Piggin <npiggin@suse.de> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 1002f473f497..b8fdf4e5e65b 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3016,3 +3016,18 @@ void print_vma_addr(char *prefix, unsigned long ip)
3016 } 3016 }
3017 up_read(&current->mm->mmap_sem); 3017 up_read(&current->mm->mmap_sem);
3018} 3018}
3019
3020#ifdef CONFIG_PROVE_LOCKING
3021void might_fault(void)
3022{
3023 might_sleep();
3024 /*
3025 * it would be nicer only to annotate paths which are not under
3026 * pagefault_disable, however that requires a larger audit and
3027 * providing helpers like get_user_atomic.
3028 */
3029 if (!in_atomic() && current->mm)
3030 might_lock_read(&current->mm->mmap_sem);
3031}
3032EXPORT_SYMBOL(might_fault);
3033#endif