Lines Matching full:mm
20 void __mmap_lock_do_trace_start_locking(struct mm_struct *mm, bool write);
21 void __mmap_lock_do_trace_acquire_returned(struct mm_struct *mm, bool write,
23 void __mmap_lock_do_trace_released(struct mm_struct *mm, bool write);
25 static inline void __mmap_lock_trace_start_locking(struct mm_struct *mm, in __mmap_lock_trace_start_locking() argument
29 __mmap_lock_do_trace_start_locking(mm, write); in __mmap_lock_trace_start_locking()
32 static inline void __mmap_lock_trace_acquire_returned(struct mm_struct *mm, in __mmap_lock_trace_acquire_returned() argument
36 __mmap_lock_do_trace_acquire_returned(mm, write, success); in __mmap_lock_trace_acquire_returned()
39 static inline void __mmap_lock_trace_released(struct mm_struct *mm, bool write) in __mmap_lock_trace_released() argument
42 __mmap_lock_do_trace_released(mm, write); in __mmap_lock_trace_released()
47 static inline void __mmap_lock_trace_start_locking(struct mm_struct *mm, in __mmap_lock_trace_start_locking() argument
52 static inline void __mmap_lock_trace_acquire_returned(struct mm_struct *mm, in __mmap_lock_trace_acquire_returned() argument
57 static inline void __mmap_lock_trace_released(struct mm_struct *mm, bool write) in __mmap_lock_trace_released() argument
63 static inline void mmap_assert_locked(const struct mm_struct *mm) in mmap_assert_locked() argument
65 rwsem_assert_held(&mm->mmap_lock); in mmap_assert_locked()
68 static inline void mmap_assert_write_locked(const struct mm_struct *mm) in mmap_assert_write_locked() argument
70 rwsem_assert_held_write(&mm->mmap_lock); in mmap_assert_write_locked()
82 static inline void vma_end_write_all(struct mm_struct *mm) in vma_end_write_all() argument
84 mmap_assert_write_locked(mm); in vma_end_write_all()
86 * Nobody can concurrently modify mm->mm_lock_seq due to exclusive in vma_end_write_all()
92 smp_store_release(&mm->mm_lock_seq, mm->mm_lock_seq + 1); in vma_end_write_all()
95 static inline void vma_end_write_all(struct mm_struct *mm) {} in vma_end_write_all() argument
98 static inline void mmap_init_lock(struct mm_struct *mm) in mmap_init_lock() argument
100 init_rwsem(&mm->mmap_lock); in mmap_init_lock()
103 static inline void mmap_write_lock(struct mm_struct *mm) in mmap_write_lock() argument
105 __mmap_lock_trace_start_locking(mm, true); in mmap_write_lock()
106 down_write(&mm->mmap_lock); in mmap_write_lock()
107 __mmap_lock_trace_acquire_returned(mm, true, true); in mmap_write_lock()
110 static inline void mmap_write_lock_nested(struct mm_struct *mm, int subclass) in mmap_write_lock_nested() argument
112 __mmap_lock_trace_start_locking(mm, true); in mmap_write_lock_nested()
113 down_write_nested(&mm->mmap_lock, subclass); in mmap_write_lock_nested()
114 __mmap_lock_trace_acquire_returned(mm, true, true); in mmap_write_lock_nested()
117 static inline int mmap_write_lock_killable(struct mm_struct *mm) in mmap_write_lock_killable() argument
121 __mmap_lock_trace_start_locking(mm, true); in mmap_write_lock_killable()
122 ret = down_write_killable(&mm->mmap_lock); in mmap_write_lock_killable()
123 __mmap_lock_trace_acquire_returned(mm, true, ret == 0); in mmap_write_lock_killable()
127 static inline void mmap_write_unlock(struct mm_struct *mm) in mmap_write_unlock() argument
129 __mmap_lock_trace_released(mm, true); in mmap_write_unlock()
130 vma_end_write_all(mm); in mmap_write_unlock()
131 up_write(&mm->mmap_lock); in mmap_write_unlock()
134 static inline void mmap_write_downgrade(struct mm_struct *mm) in mmap_write_downgrade() argument
136 __mmap_lock_trace_acquire_returned(mm, false, true); in mmap_write_downgrade()
137 vma_end_write_all(mm); in mmap_write_downgrade()
138 downgrade_write(&mm->mmap_lock); in mmap_write_downgrade()
141 static inline void mmap_read_lock(struct mm_struct *mm) in mmap_read_lock() argument
143 __mmap_lock_trace_start_locking(mm, false); in mmap_read_lock()
144 down_read(&mm->mmap_lock); in mmap_read_lock()
145 __mmap_lock_trace_acquire_returned(mm, false, true); in mmap_read_lock()
148 static inline int mmap_read_lock_killable(struct mm_struct *mm) in mmap_read_lock_killable() argument
152 __mmap_lock_trace_start_locking(mm, false); in mmap_read_lock_killable()
153 ret = down_read_killable(&mm->mmap_lock); in mmap_read_lock_killable()
154 __mmap_lock_trace_acquire_returned(mm, false, ret == 0); in mmap_read_lock_killable()
158 static inline bool mmap_read_trylock(struct mm_struct *mm) in mmap_read_trylock() argument
162 __mmap_lock_trace_start_locking(mm, false); in mmap_read_trylock()
163 ret = down_read_trylock(&mm->mmap_lock) != 0; in mmap_read_trylock()
164 __mmap_lock_trace_acquire_returned(mm, false, ret); in mmap_read_trylock()
168 static inline void mmap_read_unlock(struct mm_struct *mm) in mmap_read_unlock() argument
170 __mmap_lock_trace_released(mm, false); in mmap_read_unlock()
171 up_read(&mm->mmap_lock); in mmap_read_unlock()
174 static inline void mmap_read_unlock_non_owner(struct mm_struct *mm) in mmap_read_unlock_non_owner() argument
176 __mmap_lock_trace_released(mm, false); in mmap_read_unlock_non_owner()
177 up_read_non_owner(&mm->mmap_lock); in mmap_read_unlock_non_owner()
180 static inline int mmap_lock_is_contended(struct mm_struct *mm) in mmap_lock_is_contended() argument
182 return rwsem_is_contended(&mm->mmap_lock); in mmap_lock_is_contended()