Re: [PATCH] mm: Replace verify_mm_writelocked() by lockdep_assert_held_exclusive()

2018-12-13 Thread Vlastimil Babka
On 12/13/18 8:38 PM, Waiman Long wrote: > Using down_read_trylock() to check if a task holds a write lock on > a rwsem is not reliable. A task can hold a read lock on a rwsem and > down_read_trylock() can fail if a writer is waiting in the wait queue. > > So use lockdep_assert_held_exclusive()

[PATCH] mm: Replace verify_mm_writelocked() by lockdep_assert_held_exclusive()

2018-12-13 Thread Waiman Long
Using down_read_trylock() to check if a task holds a write lock on a rwsem is not reliable. A task can hold a read lock on a rwsem and down_read_trylock() can fail if a writer is waiting in the wait queue. So use lockdep_assert_held_exclusive() instead which can do the right check when