• Home
  • Raw
  • Download

Lines Matching refs:lock

743 static void print_lockdep_cache(struct lockdep_map *lock)  in print_lockdep_cache()  argument
748 name = lock->name; in print_lockdep_cache()
750 name = __get_key_name(lock->key->subkeys, str); in print_lockdep_cache()
767 struct lock_class *lock = hlock_class(hlock); in print_lock() local
769 if (!lock) { in print_lock()
775 print_lock_name(lock); in print_lock()
880 look_up_lock_class(const struct lockdep_map *lock, unsigned int subclass) in look_up_lock_class() argument
902 if (unlikely(!lock->key)) in look_up_lock_class()
914 key = lock->key->subkeys + subclass; in look_up_lock_class()
930 WARN_ONCE(class->name != lock->name && in look_up_lock_class()
931 lock->key != &__lockdep_no_validate__, in look_up_lock_class()
933 lock->name, lock->key, class->name); in look_up_lock_class()
946 static bool assign_lock_key(struct lockdep_map *lock) in assign_lock_key() argument
948 unsigned long can_addr, addr = (unsigned long)lock; in assign_lock_key()
962 lock->key = (void *)can_addr; in assign_lock_key()
964 lock->key = (void *)can_addr; in assign_lock_key()
965 else if (static_obj(lock)) in assign_lock_key()
966 lock->key = (void *)lock; in assign_lock_key()
1273 register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force) in register_lock_class() argument
1282 class = look_up_lock_class(lock, subclass); in register_lock_class()
1286 if (!lock->key) { in register_lock_class()
1287 if (!assign_lock_key(lock)) in register_lock_class()
1289 } else if (!static_obj(lock->key) && !is_dynamic_key(lock->key)) { in register_lock_class()
1293 key = lock->key->subkeys + subclass; in register_lock_class()
1326 class->name = lock->name; in register_lock_class()
1331 class->wait_type_inner = lock->wait_type_inner; in register_lock_class()
1332 class->wait_type_outer = lock->wait_type_outer; in register_lock_class()
1333 class->lock_type = lock->lock_type; in register_lock_class()
1366 lock->class_cache[0] = class; in register_lock_class()
1368 lock->class_cache[subclass] = class; in register_lock_class()
1494 struct lock_list * lock; in __cq_dequeue() local
1499 lock = cq->element[cq->front]; in __cq_dequeue()
1502 return lock; in __cq_dequeue()
1510 static inline void mark_lock_accessed(struct lock_list *lock) in mark_lock_accessed() argument
1512 lock->class->dep_gen_id = lockdep_dependency_gen_id; in mark_lock_accessed()
1515 static inline void visit_lock_entry(struct lock_list *lock, in visit_lock_entry() argument
1518 lock->parent = parent; in visit_lock_entry()
1521 static inline unsigned long lock_accessed(struct lock_list *lock) in lock_accessed() argument
1523 return lock->class->dep_gen_id == lockdep_dependency_gen_id; in lock_accessed()
1550 static inline struct list_head *get_dep_list(struct lock_list *lock, int offset) in get_dep_list() argument
1552 void *lock_class = lock->class; in get_dep_list()
1642 static inline void __bfs_init_root(struct lock_list *lock, in __bfs_init_root() argument
1645 lock->class = class; in __bfs_init_root()
1646 lock->parent = NULL; in __bfs_init_root()
1647 lock->only_xr = 0; in __bfs_init_root()
1658 static inline void bfs_init_root(struct lock_list *lock, in bfs_init_root() argument
1661 __bfs_init_root(lock, hlock_class(hlock)); in bfs_init_root()
1662 lock->only_xr = (hlock->read == 2); in bfs_init_root()
1672 static inline void bfs_init_rootb(struct lock_list *lock, in bfs_init_rootb() argument
1675 __bfs_init_root(lock, hlock_class(hlock)); in bfs_init_rootb()
1676 lock->only_xr = (hlock->read != 0); in bfs_init_rootb()
1679 static inline struct lock_list *__bfs_next(struct lock_list *lock, int offset) in __bfs_next() argument
1681 if (!lock || !lock->parent) in __bfs_next()
1684 return list_next_or_null_rcu(get_dep_list(lock->parent, offset), in __bfs_next()
1685 &lock->entry, struct lock_list, entry); in __bfs_next()
1723 struct lock_list *lock = NULL; in __bfs() local
1734 while ((lock = __bfs_next(lock, offset)) || (lock = __cq_dequeue(cq))) { in __bfs()
1735 if (!lock->class) in __bfs()
1747 if (lock_accessed(lock)) in __bfs()
1750 mark_lock_accessed(lock); in __bfs()
1756 if (lock->parent) { /* Parent exists, check prev dependency */ in __bfs()
1757 u8 dep = lock->dep; in __bfs()
1758 bool prev_only_xr = lock->parent->only_xr; in __bfs()
1773 lock->only_xr = !(dep & (DEP_SN_MASK | DEP_EN_MASK)); in __bfs()
1782 if (skip && skip(lock, data)) in __bfs()
1785 if (match(lock, data)) { in __bfs()
1786 *target_entry = lock; in __bfs()
1796 head = get_dep_list(lock, offset); in __bfs()
1798 visit_lock_entry(entry, lock); in __bfs()
3906 static void print_usage_bug_scenario(struct held_lock *lock) in print_usage_bug_scenario() argument
3908 struct lock_class *class = hlock_class(lock); in print_usage_bug_scenario()
4797 void lockdep_init_map_type(struct lockdep_map *lock, const char *name, in lockdep_init_map_type() argument
4804 lock->class_cache[i] = NULL; in lockdep_init_map_type()
4807 lock->cpu = raw_smp_processor_id(); in lockdep_init_map_type()
4814 lock->name = "NULL"; in lockdep_init_map_type()
4818 lock->name = name; in lockdep_init_map_type()
4820 lock->wait_type_outer = outer; in lockdep_init_map_type()
4821 lock->wait_type_inner = inner; in lockdep_init_map_type()
4822 lock->lock_type = lock_type; in lockdep_init_map_type()
4839 lock->key = key; in lockdep_init_map_type()
4852 register_lock_class(lock, subclass, 1); in lockdep_init_map_type()
4893 static int __lock_is_held(const struct lockdep_map *lock, int read);
4903 static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, in __lock_acquire() argument
4919 if (!prove_locking || lock->key == &__lockdep_no_validate__) in __lock_acquire()
4923 class = lock->class_cache[subclass]; in __lock_acquire()
4928 class = register_lock_class(lock, subclass, 0); in __lock_acquire()
4985 hlock->instance = lock; in __lock_acquire()
5079 struct lockdep_map *lock, in print_unlock_imbalance_bug() argument
5094 print_lockdep_cache(lock); in print_unlock_imbalance_bug()
5106 const struct lockdep_map *lock) in match_held_lock() argument
5108 if (hlock->instance == lock) in match_held_lock()
5112 const struct lock_class *class = lock->class_cache[0]; in match_held_lock()
5115 class = look_up_lock_class(lock, 0); in match_held_lock()
5143 struct lockdep_map *lock, in find_held_lock() argument
5152 if (match_held_lock(hlock, lock)) in find_held_lock()
5166 if (match_held_lock(hlock, lock)) { in find_held_lock()
5210 __lock_set_class(struct lockdep_map *lock, const char *name, in __lock_set_class() argument
5231 hlock = find_held_lock(curr, lock, depth, &i); in __lock_set_class()
5233 print_unlock_imbalance_bug(curr, lock, ip); in __lock_set_class()
5237 lockdep_init_map_type(lock, name, key, 0, in __lock_set_class()
5238 lock->wait_type_inner, in __lock_set_class()
5239 lock->wait_type_outer, in __lock_set_class()
5240 lock->lock_type); in __lock_set_class()
5241 class = register_lock_class(lock, subclass, 0); in __lock_set_class()
5259 static int __lock_downgrade(struct lockdep_map *lock, unsigned long ip) in __lock_downgrade() argument
5277 hlock = find_held_lock(curr, lock, depth, &i); in __lock_downgrade()
5279 print_unlock_imbalance_bug(curr, lock, ip); in __lock_downgrade()
5313 __lock_release(struct lockdep_map *lock, unsigned long ip) in __lock_release() argument
5329 print_unlock_imbalance_bug(curr, lock, ip); in __lock_release()
5337 hlock = find_held_lock(curr, lock, depth, &i); in __lock_release()
5339 print_unlock_imbalance_bug(curr, lock, ip); in __lock_release()
5343 if (hlock->instance == lock) in __lock_release()
5395 int __lock_is_held(const struct lockdep_map *lock, int read) in __lock_is_held() argument
5403 if (match_held_lock(hlock, lock)) { in __lock_is_held()
5414 static struct pin_cookie __lock_pin_lock(struct lockdep_map *lock) in __lock_pin_lock() argument
5426 if (match_held_lock(hlock, lock)) { in __lock_pin_lock()
5442 static void __lock_repin_lock(struct lockdep_map *lock, struct pin_cookie cookie) in __lock_repin_lock() argument
5453 if (match_held_lock(hlock, lock)) { in __lock_repin_lock()
5462 static void __lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie cookie) in __lock_unpin_lock() argument
5473 if (match_held_lock(hlock, lock)) { in __lock_unpin_lock()
5535 void lock_set_class(struct lockdep_map *lock, const char *name, in lock_set_class() argument
5547 if (__lock_set_class(lock, name, key, subclass, ip)) in lock_set_class()
5554 void lock_downgrade(struct lockdep_map *lock, unsigned long ip) in lock_downgrade() argument
5564 if (__lock_downgrade(lock, ip)) in lock_downgrade()
5572 static void verify_lock_unused(struct lockdep_map *lock, struct held_lock *hlock, int subclass) in verify_lock_unused() argument
5575 struct lock_class *class = look_up_lock_class(lock, subclass); in verify_lock_unused()
5627 void lock_acquire(struct lockdep_map *lock, unsigned int subclass, in lock_acquire() argument
5633 trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); in lock_acquire()
5644 hlock.instance = lock; in lock_acquire()
5653 verify_lock_unused(lock, &hlock, subclass); in lock_acquire()
5662 __lock_acquire(lock, subclass, trylock, read, check, in lock_acquire()
5669 void lock_release(struct lockdep_map *lock, unsigned long ip) in lock_release() argument
5673 trace_lock_release(lock, ip); in lock_release()
5682 if (__lock_release(lock, ip)) in lock_release()
5689 noinstr int lock_is_held_type(const struct lockdep_map *lock, int read) in lock_is_held_type() argument
5705 ret = __lock_is_held(lock, read); in lock_is_held_type()
5714 struct pin_cookie lock_pin_lock(struct lockdep_map *lock) in lock_pin_lock() argument
5726 cookie = __lock_pin_lock(lock); in lock_pin_lock()
5734 void lock_repin_lock(struct lockdep_map *lock, struct pin_cookie cookie) in lock_repin_lock() argument
5745 __lock_repin_lock(lock, cookie); in lock_repin_lock()
5751 void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie cookie) in lock_unpin_lock() argument
5762 __lock_unpin_lock(lock, cookie); in lock_unpin_lock()
5770 struct lockdep_map *lock, in print_lock_contention_bug() argument
5785 print_lockdep_cache(lock); in print_lock_contention_bug()
5797 __lock_contended(struct lockdep_map *lock, unsigned long ip) in __lock_contended() argument
5813 hlock = find_held_lock(curr, lock, depth, &i); in __lock_contended()
5815 print_lock_contention_bug(curr, lock, ip); in __lock_contended()
5819 if (hlock->instance != lock) in __lock_contended()
5826 lock->ip); in __lock_contended()
5833 if (lock->cpu != smp_processor_id()) in __lock_contended()
5838 __lock_acquired(struct lockdep_map *lock, unsigned long ip) in __lock_acquired() argument
5855 hlock = find_held_lock(curr, lock, depth, &i); in __lock_acquired()
5857 print_lock_contention_bug(curr, lock, _RET_IP_); in __lock_acquired()
5861 if (hlock->instance != lock) in __lock_acquired()
5878 if (lock->cpu != cpu) in __lock_acquired()
5881 lock->cpu = cpu; in __lock_acquired()
5882 lock->ip = ip; in __lock_acquired()
5885 void lock_contended(struct lockdep_map *lock, unsigned long ip) in lock_contended() argument
5889 trace_lock_contended(lock, ip); in lock_contended()
5897 __lock_contended(lock, ip); in lock_contended()
5903 void lock_acquired(struct lockdep_map *lock, unsigned long ip) in lock_acquired() argument
5907 trace_lock_acquired(lock, ip); in lock_acquired()
5915 __lock_acquired(lock, ip); in lock_acquired()
6221 static bool lock_class_cache_is_registered(struct lockdep_map *lock) in lock_class_cache_is_registered() argument
6231 if (lock->class_cache[j] == class) in lock_class_cache_is_registered()
6240 struct lockdep_map *lock) in __lockdep_reset_lock() argument
6252 class = look_up_lock_class(lock, j); in __lockdep_reset_lock()
6260 if (WARN_ON_ONCE(lock_class_cache_is_registered(lock))) in __lockdep_reset_lock()
6268 static void lockdep_reset_lock_reg(struct lockdep_map *lock) in lockdep_reset_lock_reg() argument
6280 __lockdep_reset_lock(pf, lock); in lockdep_reset_lock_reg()
6292 static void lockdep_reset_lock_imm(struct lockdep_map *lock) in lockdep_reset_lock_imm() argument
6299 __lockdep_reset_lock(pf, lock); in lockdep_reset_lock_imm()
6305 void lockdep_reset_lock(struct lockdep_map *lock) in lockdep_reset_lock() argument
6310 lockdep_reset_lock_imm(lock); in lockdep_reset_lock()
6312 lockdep_reset_lock_reg(lock); in lockdep_reset_lock()