Skip to content

Commit

Permalink
[PATCH] lockdep: annotate ->mmap_sem
Browse files Browse the repository at this point in the history
Teach special (recursive) locking code to the lock validator.  Has no effect
on non-lockdep kernels.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Jul 3, 2006
1 parent d378834 commit ad33945
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ static inline int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)

down_write(&oldmm->mmap_sem);
flush_cache_mm(oldmm);
down_write(&mm->mmap_sem);
/*
* Not linked in yet - no deadlock potential:
*/
down_write_nested(&mm->mmap_sem, SINGLE_DEPTH_NESTING);

mm->locked_vm = 0;
mm->mmap = NULL;
Expand Down

0 comments on commit ad33945

Please sign in to comment.