aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-01-12 07:02:11 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-12 07:09:18 -0500
commit95156f0051cba60ec674bbaa5cf7dc74a74c5612 (patch)
treeb2927d543b7b8e89e8dcb7ebf7f37d07afdc62f0 /mm/memory.c
parent9d0793370987b98708d2f75ee3bba7c1008d8512 (diff)
lockdep, mm: fix might_fault() annotation
Some code (nfs/sunrpc) uses socket ops on kernel memory while holding the mmap_sem, this is safe because kernel memory doesn't get paged out, therefore we'll never actually fault, and the might_fault() annotations will generate false positives. Reported-by: "J. Bruce Fields" <bfields@fieldses.org> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c
index e009ce870859..c2d4c477e5bb 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3165,6 +3165,15 @@ void print_vma_addr(char *prefix, unsigned long ip)
3165#ifdef CONFIG_PROVE_LOCKING 3165#ifdef CONFIG_PROVE_LOCKING
3166void might_fault(void) 3166void might_fault(void)
3167{ 3167{
3168 /*
3169 * Some code (nfs/sunrpc) uses socket ops on kernel memory while
3170 * holding the mmap_sem, this is safe because kernel memory doesn't
3171 * get paged out, therefore we'll never actually fault, and the
3172 * below annotations will generate false positives.
3173 */
3174 if (segment_eq(get_fs(), KERNEL_DS))
3175 return;
3176
3168 might_sleep(); 3177 might_sleep();
3169 /* 3178 /*
3170 * it would be nicer only to annotate paths which are not under 3179 * it would be nicer only to annotate paths which are not under