summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-11-23 23:57:23 +0100
committerIngo Molnar <mingo@elte.hu>2008-11-23 23:57:23 +0100
commit44b32178f447c1d63036ef7e7133b8038f0b1955 (patch)
tree5c00a9e960e68c0e103479121e6cf8d70fd33668 /mm
parent36f25f6ada995594117c2520577e02789fbfbd17 (diff)
parente25cf3db560e803292946ef23a30c69e341ce56f (diff)
Merge branch 'core/locking' into auto-core-next
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 164951c47305..fc031d68327e 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3049,3 +3049,18 @@ void print_vma_addr(char *prefix, unsigned long ip)
}
up_read(&current->mm->mmap_sem);
}
+
+#ifdef CONFIG_PROVE_LOCKING
+void might_fault(void)
+{
+ might_sleep();
+ /*
+ * it would be nicer only to annotate paths which are not under
+ * pagefault_disable, however that requires a larger audit and
+ * providing helpers like get_user_atomic.
+ */
+ if (!in_atomic() && current->mm)
+ might_lock_read(&current->mm->mmap_sem);
+}
+EXPORT_SYMBOL(might_fault);
+#endif