mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
Lockdep treats down_write_trylock like regular down_write
This causes constructions like down_write(&mm1->mmap_sem); if (down_write_trylock(&mm2->mmap_sem)) { ... up_write(&mm2->mmap_sem); } up_write(&mm1->mmap_sem); generate a lockdep warning about circular locking dependence. Call rwsem_acquire() with trylock set to 1. Cc: Ingo Molnar <mingo@elte.hu> Cc: Arjan van de Ven <arjan@infradead.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
644fd4f5de
commit
428e6ce023
1 changed files with 1 additions and 1 deletions
|
@ -60,7 +60,7 @@ int down_write_trylock(struct rw_semaphore *sem)
|
||||||
int ret = __down_write_trylock(sem);
|
int ret = __down_write_trylock(sem);
|
||||||
|
|
||||||
if (ret == 1)
|
if (ret == 1)
|
||||||
rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
|
rwsem_acquire(&sem->dep_map, 0, 1, _RET_IP_);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue