Lines Matching refs:curr

1951 	struct task_struct *curr = current;  in print_circular_bug_header()  local
1962 curr->comm, task_pid_nr(curr)); in print_circular_bug_header()
2041 struct task_struct *curr = current; in print_circular_bug() local
2071 lockdep_print_held_locks(curr); in print_circular_bug()
2578 print_bad_irq_dependency(struct task_struct *curr, in print_bad_irq_dependency() argument
2601 curr->comm, task_pid_nr(curr), in print_bad_irq_dependency()
2603 curr->softirq_context, softirq_count() >> SOFTIRQ_SHIFT, in print_bad_irq_dependency()
2605 curr->softirqs_enabled); in print_bad_irq_dependency()
2634 lockdep_print_held_locks(curr); in print_bad_irq_dependency()
2811 static int check_irq_usage(struct task_struct *curr, struct held_lock *prev, in check_irq_usage() argument
2888 print_bad_irq_dependency(curr, &this, &that, in check_irq_usage()
2899 static inline int check_irq_usage(struct task_struct *curr, in check_irq_usage() argument
3006 print_deadlock_bug(struct task_struct *curr, struct held_lock *prev, in print_deadlock_bug() argument
3022 curr->comm, task_pid_nr(curr)); in print_deadlock_bug()
3034 lockdep_print_held_locks(curr); in print_deadlock_bug()
3053 check_deadlock(struct task_struct *curr, struct held_lock *next) in check_deadlock() argument
3060 for (i = 0; i < curr->lockdep_depth; i++) { in check_deadlock()
3061 prev = curr->held_locks + i; in check_deadlock()
3089 print_deadlock_bug(curr, prev, next); in check_deadlock()
3118 check_prev_add(struct task_struct *curr, struct held_lock *prev, in check_prev_add() argument
3165 if (!check_irq_usage(curr, prev, next)) in check_prev_add()
3254 check_prevs_add(struct task_struct *curr, struct held_lock *next) in check_prevs_add() argument
3257 int depth = curr->lockdep_depth; in check_prevs_add()
3271 if (curr->held_locks[depth].irq_context != in check_prevs_add()
3272 curr->held_locks[depth-1].irq_context) in check_prevs_add()
3276 u16 distance = curr->lockdep_depth - depth + 1; in check_prevs_add()
3277 hlock = curr->held_locks + depth - 1; in check_prevs_add()
3280 int ret = check_prev_add(curr, hlock, next, distance, &trace); in check_prevs_add()
3303 if (curr->held_locks[depth].irq_context != in check_prevs_add()
3304 curr->held_locks[depth-1].irq_context) in check_prevs_add()
3364 #define for_each_chain_block(bucket, prev, curr) \ argument
3365 for ((prev) = -1, (curr) = chain_block_buckets[bucket]; \
3366 (curr) >= 0; \
3367 (prev) = (curr), (curr) = chain_block_next(curr))
3411 int prev, curr; in add_chain_block() local
3433 for_each_chain_block(0, prev, curr) { in add_chain_block()
3434 if (size >= chain_block_size(curr)) in add_chain_block()
3437 init_chain_block(offset, curr, 0, size); in add_chain_block()
3489 int bucket, curr, size; in alloc_chain_hlocks() local
3508 curr = chain_block_buckets[bucket]; in alloc_chain_hlocks()
3511 if (curr >= 0) { in alloc_chain_hlocks()
3512 del_chain_block(bucket, req, chain_block_next(curr)); in alloc_chain_hlocks()
3513 return curr; in alloc_chain_hlocks()
3516 curr = chain_block_buckets[0]; in alloc_chain_hlocks()
3523 if (curr >= 0) { in alloc_chain_hlocks()
3524 size = chain_block_size(curr); in alloc_chain_hlocks()
3526 del_chain_block(0, size, chain_block_next(curr)); in alloc_chain_hlocks()
3528 add_chain_block(curr + req, size - req); in alloc_chain_hlocks()
3529 return curr; in alloc_chain_hlocks()
3538 curr = chain_block_buckets[bucket]; in alloc_chain_hlocks()
3539 if (curr < 0) in alloc_chain_hlocks()
3542 del_chain_block(bucket, size, chain_block_next(curr)); in alloc_chain_hlocks()
3543 add_chain_block(curr + req, size - req); in alloc_chain_hlocks()
3544 return curr; in alloc_chain_hlocks()
3566 static inline int get_first_held_lock(struct task_struct *curr, in get_first_held_lock() argument
3572 for (i = curr->lockdep_depth - 1; i >= 0; i--) { in get_first_held_lock()
3573 hlock_curr = curr->held_locks + i; in get_first_held_lock()
3597 print_chain_keys_held_locks(struct task_struct *curr, struct held_lock *hlock_next) in print_chain_keys_held_locks() argument
3601 int depth = curr->lockdep_depth; in print_chain_keys_held_locks()
3602 int i = get_first_held_lock(curr, hlock_next); in print_chain_keys_held_locks()
3607 hlock = curr->held_locks + i; in print_chain_keys_held_locks()
3633 static void print_collision(struct task_struct *curr, in print_collision() argument
3648 print_chain_keys_held_locks(curr, hlock_next); in print_collision()
3666 static int check_no_collision(struct task_struct *curr, in check_no_collision() argument
3673 i = get_first_held_lock(curr, hlock); in check_no_collision()
3675 if (DEBUG_LOCKS_WARN_ON(chain->depth != curr->lockdep_depth - (i - 1))) { in check_no_collision()
3676 print_collision(curr, hlock, chain); in check_no_collision()
3681 id = hlock_id(&curr->held_locks[i]); in check_no_collision()
3684 print_collision(curr, hlock, chain); in check_no_collision()
3726 static inline int add_chain_cache(struct task_struct *curr, in add_chain_cache() argument
3755 i = get_first_held_lock(curr, hlock); in add_chain_cache()
3756 chain->depth = curr->lockdep_depth + 1 - i; in add_chain_cache()
3759 BUILD_BUG_ON((1UL << 6) <= ARRAY_SIZE(curr->held_locks)); in add_chain_cache()
3776 int lock_id = hlock_id(curr->held_locks + i); in add_chain_cache()
3812 static inline int lookup_chain_cache_add(struct task_struct *curr, in lookup_chain_cache_add() argument
3821 if (!check_no_collision(curr, hlock, chain)) in lookup_chain_cache_add()
3851 if (!add_chain_cache(curr, hlock, chain_key)) in lookup_chain_cache_add()
3857 static int validate_chain(struct task_struct *curr, in validate_chain() argument
3872 lookup_chain_cache_add(curr, hlock, chain_key)) { in validate_chain()
3891 int ret = check_deadlock(curr, hlock); in validate_chain()
3904 if (!check_prevs_add(curr, hlock)) in validate_chain()
3918 static inline int validate_chain(struct task_struct *curr, in validate_chain() argument
3932 static void check_chain_key(struct task_struct *curr) in check_chain_key() argument
3939 for (i = 0; i < curr->lockdep_depth; i++) { in check_chain_key()
3940 hlock = curr->held_locks + i; in check_chain_key()
3948 curr->lockdep_depth, i, in check_chain_key()
3967 if (chain_key != curr->curr_chain_key) { in check_chain_key()
3974 curr->lockdep_depth, i, in check_chain_key()
3976 (unsigned long long)curr->curr_chain_key); in check_chain_key()
3982 static int mark_lock(struct task_struct *curr, struct held_lock *this,
4003 print_usage_bug(struct task_struct *curr, struct held_lock *this, in print_usage_bug() argument
4021 curr->comm, task_pid_nr(curr), in print_usage_bug()
4023 lockdep_softirq_context(curr), softirq_count() >> SOFTIRQ_SHIFT, in print_usage_bug()
4025 lockdep_softirqs_enabled(curr)); in print_usage_bug()
4031 print_irqtrace_events(curr); in print_usage_bug()
4035 lockdep_print_held_locks(curr); in print_usage_bug()
4047 valid_state(struct task_struct *curr, struct held_lock *this, in valid_state() argument
4052 print_usage_bug(curr, this, bad_bit, new_bit); in valid_state()
4063 print_irq_inversion_bug(struct task_struct *curr, in print_irq_inversion_bug() argument
4083 curr->comm, task_pid_nr(curr)); in print_irq_inversion_bug()
4112 lockdep_print_held_locks(curr); in print_irq_inversion_bug()
4131 check_usage_forwards(struct task_struct *curr, struct held_lock *this, in check_usage_forwards() argument
4151 print_irq_inversion_bug(curr, &root, target_entry, in check_usage_forwards()
4154 print_irq_inversion_bug(curr, &root, target_entry, in check_usage_forwards()
4166 check_usage_backwards(struct task_struct *curr, struct held_lock *this, in check_usage_backwards() argument
4186 print_irq_inversion_bug(curr, &root, target_entry, in check_usage_backwards()
4189 print_irq_inversion_bug(curr, &root, target_entry, in check_usage_backwards()
4196 void print_irqtrace_events(struct task_struct *curr) in print_irqtrace_events() argument
4198 const struct irqtrace_events *trace = &curr->irqtrace; in print_irqtrace_events()
4252 mark_lock_irq(struct task_struct *curr, struct held_lock *this, in mark_lock_irq() argument
4263 if (!valid_state(curr, this, new_bit, excl_bit)) in mark_lock_irq()
4269 if (!read && !valid_state(curr, this, new_bit, in mark_lock_irq()
4283 if (!check_usage_backwards(curr, this, excl_bit)) in mark_lock_irq()
4290 if (!check_usage_forwards(curr, this, excl_bit)) in mark_lock_irq()
4304 mark_held_locks(struct task_struct *curr, enum lock_usage_bit base_bit) in mark_held_locks() argument
4309 for (i = 0; i < curr->lockdep_depth; i++) { in mark_held_locks()
4311 hlock = curr->held_locks + i; in mark_held_locks()
4321 if (!mark_lock(curr, hlock, hlock_bit)) in mark_held_locks()
4333 struct task_struct *curr = current; in __trace_hardirqs_on_caller() local
4339 if (!mark_held_locks(curr, LOCK_ENABLED_HARDIRQ)) in __trace_hardirqs_on_caller()
4346 if (curr->softirqs_enabled) in __trace_hardirqs_on_caller()
4347 mark_held_locks(curr, LOCK_ENABLED_SOFTIRQ); in __trace_hardirqs_on_caller()
4590 mark_usage(struct task_struct *curr, struct held_lock *hlock, int check) in mark_usage() argument
4602 if (!mark_lock(curr, hlock, in mark_usage()
4605 if (curr->softirq_context) in mark_usage()
4606 if (!mark_lock(curr, hlock, in mark_usage()
4611 if (!mark_lock(curr, hlock, LOCK_USED_IN_HARDIRQ)) in mark_usage()
4613 if (curr->softirq_context) in mark_usage()
4614 if (!mark_lock(curr, hlock, LOCK_USED_IN_SOFTIRQ)) in mark_usage()
4626 if (!mark_lock(curr, hlock, in mark_usage()
4629 if (curr->softirqs_enabled) in mark_usage()
4630 if (!mark_lock(curr, hlock, in mark_usage()
4634 if (!mark_lock(curr, hlock, in mark_usage()
4637 if (curr->softirqs_enabled) in mark_usage()
4638 if (!mark_lock(curr, hlock, in mark_usage()
4646 if (!mark_lock(curr, hlock, LOCK_USED)) in mark_usage()
4658 static int separate_irq_context(struct task_struct *curr, in separate_irq_context() argument
4661 unsigned int depth = curr->lockdep_depth; in separate_irq_context()
4669 prev_hlock = curr->held_locks + depth-1; in separate_irq_context()
4684 static int mark_lock(struct task_struct *curr, struct held_lock *this, in mark_lock() argument
4725 ret = mark_lock_irq(curr, this, new_bit); in mark_lock()
4740 print_irqtrace_events(curr); in mark_lock()
4748 static inline short task_wait_context(struct task_struct *curr) in task_wait_context() argument
4758 if (curr->hardirq_threaded || curr->irq_config) in task_wait_context()
4762 } else if (curr->softirq_context) { in task_wait_context()
4773 print_lock_invalid_wait_context(struct task_struct *curr, in print_lock_invalid_wait_context() argument
4791 pr_warn("%s/%d is trying to lock:\n", curr->comm, task_pid_nr(curr)); in print_lock_invalid_wait_context()
4796 curr_inner = task_wait_context(curr); in print_lock_invalid_wait_context()
4799 lockdep_print_held_locks(curr); in print_lock_invalid_wait_context()
4824 static int check_wait_context(struct task_struct *curr, struct held_lock *next) in check_wait_context() argument
4840 for (depth = curr->lockdep_depth - 1; depth >= 0; depth--) { in check_wait_context()
4841 struct held_lock *prev = curr->held_locks + depth; in check_wait_context()
4847 curr_inner = task_wait_context(curr); in check_wait_context()
4849 for (; depth < curr->lockdep_depth; depth++) { in check_wait_context()
4850 struct held_lock *prev = curr->held_locks + depth; in check_wait_context()
4874 return print_lock_invalid_wait_context(curr, next); in check_wait_context()
4882 mark_usage(struct task_struct *curr, struct held_lock *hlock, int check) in mark_usage() argument
4892 static inline int separate_irq_context(struct task_struct *curr, in separate_irq_context() argument
4898 static inline int check_wait_context(struct task_struct *curr, in check_wait_context() argument
5005 print_lock_nested_lock_not_held(struct task_struct *curr, in print_lock_nested_lock_not_held() argument
5021 pr_warn("%s/%d is trying to lock:\n", curr->comm, task_pid_nr(curr)); in print_lock_nested_lock_not_held()
5031 lockdep_print_held_locks(curr); in print_lock_nested_lock_not_held()
5054 struct task_struct *curr = current; in __lock_acquire() local
5099 depth = curr->lockdep_depth; in __lock_acquire()
5110 hlock = curr->held_locks + depth - 1; in __lock_acquire()
5128 hlock = curr->held_locks + depth; in __lock_acquire()
5139 hlock->irq_context = task_irq_context(curr); in __lock_acquire()
5152 if (check_wait_context(curr, hlock)) in __lock_acquire()
5156 if (!mark_usage(curr, hlock, check)) in __lock_acquire()
5175 chain_key = curr->curr_chain_key; in __lock_acquire()
5186 if (separate_irq_context(curr, hlock)) { in __lock_acquire()
5193 print_lock_nested_lock_not_held(curr, hlock); in __lock_acquire()
5202 if (!validate_chain(curr, hlock, chain_head, chain_key)) in __lock_acquire()
5209 curr->curr_chain_key = chain_key; in __lock_acquire()
5210 curr->lockdep_depth++; in __lock_acquire()
5211 check_chain_key(curr); in __lock_acquire()
5216 if (unlikely(curr->lockdep_depth >= MAX_LOCK_DEPTH)) { in __lock_acquire()
5221 curr->lockdep_depth, MAX_LOCK_DEPTH); in __lock_acquire()
5231 if (unlikely(curr->lockdep_depth > max_lockdep_depth)) in __lock_acquire()
5232 max_lockdep_depth = curr->lockdep_depth; in __lock_acquire()
5237 static void print_unlock_imbalance_bug(struct task_struct *curr, in print_unlock_imbalance_bug() argument
5254 curr->comm, task_pid_nr(curr)); in print_unlock_imbalance_bug()
5260 lockdep_print_held_locks(curr); in print_unlock_imbalance_bug()
5305 static struct held_lock *find_held_lock(struct task_struct *curr, in find_held_lock() argument
5313 hlock = curr->held_locks + i; in find_held_lock()
5340 static int reacquire_held_locks(struct task_struct *curr, unsigned int depth, in reacquire_held_locks() argument
5349 for (hlock = curr->held_locks + idx; idx < depth; idx++, hlock++) { in reacquire_held_locks()
5377 struct task_struct *curr = current; in __lock_set_class() local
5386 depth = curr->lockdep_depth; in __lock_set_class()
5394 hlock = find_held_lock(curr, lock, depth, &i); in __lock_set_class()
5396 print_unlock_imbalance_bug(curr, lock, ip); in __lock_set_class()
5407 curr->lockdep_depth = i; in __lock_set_class()
5408 curr->curr_chain_key = hlock->prev_chain_key; in __lock_set_class()
5410 if (reacquire_held_locks(curr, depth, i, &merged)) in __lock_set_class()
5417 if (DEBUG_LOCKS_WARN_ON(curr->lockdep_depth != depth - merged)) in __lock_set_class()
5424 struct task_struct *curr = current; in __lock_downgrade() local
5432 depth = curr->lockdep_depth; in __lock_downgrade()
5440 hlock = find_held_lock(curr, lock, depth, &i); in __lock_downgrade()
5442 print_unlock_imbalance_bug(curr, lock, ip); in __lock_downgrade()
5446 curr->lockdep_depth = i; in __lock_downgrade()
5447 curr->curr_chain_key = hlock->prev_chain_key; in __lock_downgrade()
5453 if (reacquire_held_locks(curr, depth, i, &merged)) in __lock_downgrade()
5464 if (DEBUG_LOCKS_WARN_ON(curr->lockdep_depth != depth)) in __lock_downgrade()
5478 struct task_struct *curr = current; in __lock_release() local
5486 depth = curr->lockdep_depth; in __lock_release()
5492 print_unlock_imbalance_bug(curr, lock, ip); in __lock_release()
5500 hlock = find_held_lock(curr, lock, depth, &i); in __lock_release()
5502 print_unlock_imbalance_bug(curr, lock, ip); in __lock_release()
5529 curr->lockdep_depth = i; in __lock_release()
5530 curr->curr_chain_key = hlock->prev_chain_key; in __lock_release()
5539 if (reacquire_held_locks(curr, depth, i + 1, &merged)) in __lock_release()
5547 DEBUG_LOCKS_WARN_ON(curr->lockdep_depth != depth - merged); in __lock_release()
5560 struct task_struct *curr = current; in __lock_is_held() local
5563 for (i = 0; i < curr->lockdep_depth; i++) { in __lock_is_held()
5564 struct held_lock *hlock = curr->held_locks + i; in __lock_is_held()
5580 struct task_struct *curr = current; in __lock_pin_lock() local
5586 for (i = 0; i < curr->lockdep_depth; i++) { in __lock_pin_lock()
5587 struct held_lock *hlock = curr->held_locks + i; in __lock_pin_lock()
5607 struct task_struct *curr = current; in __lock_repin_lock() local
5613 for (i = 0; i < curr->lockdep_depth; i++) { in __lock_repin_lock()
5614 struct held_lock *hlock = curr->held_locks + i; in __lock_repin_lock()
5627 struct task_struct *curr = current; in __lock_unpin_lock() local
5633 for (i = 0; i < curr->lockdep_depth; i++) { in __lock_unpin_lock()
5634 struct held_lock *hlock = curr->held_locks + i; in __lock_unpin_lock()
5961 static void print_lock_contention_bug(struct task_struct *curr, in print_lock_contention_bug() argument
5978 curr->comm, task_pid_nr(curr)); in print_lock_contention_bug()
5984 lockdep_print_held_locks(curr); in print_lock_contention_bug()
5995 struct task_struct *curr = current; in __lock_contended() local
6001 depth = curr->lockdep_depth; in __lock_contended()
6012 hlock = find_held_lock(curr, lock, depth, &i); in __lock_contended()
6014 print_lock_contention_bug(curr, lock, ip); in __lock_contended()
6039 struct task_struct *curr = current; in __lock_acquired() local
6046 depth = curr->lockdep_depth; in __lock_acquired()
6057 hlock = find_held_lock(curr, lock, depth, &i); in __lock_acquired()
6059 print_lock_contention_bug(curr, lock, _RET_IP_); in __lock_acquired()
6617 print_freed_lock_bug(struct task_struct *curr, const void *mem_from, in print_freed_lock_bug() argument
6633 curr->comm, task_pid_nr(curr), mem_from, mem_to-1); in print_freed_lock_bug()
6635 lockdep_print_held_locks(curr); in print_freed_lock_bug()
6657 struct task_struct *curr = current; in debug_check_no_locks_freed() local
6666 for (i = 0; i < curr->lockdep_depth; i++) { in debug_check_no_locks_freed()
6667 hlock = curr->held_locks + i; in debug_check_no_locks_freed()
6673 print_freed_lock_bug(curr, mem_from, mem_from + mem_len, hlock); in debug_check_no_locks_freed()
6752 struct task_struct *curr = current; in lockdep_sys_exit() local
6754 if (unlikely(curr->lockdep_depth)) { in lockdep_sys_exit()
6764 curr->comm, curr->pid); in lockdep_sys_exit()
6765 lockdep_print_held_locks(curr); in lockdep_sys_exit()
6778 struct task_struct *curr = current; in lockdep_rcu_suspicious() local
6819 lockdep_print_held_locks(curr); in lockdep_rcu_suspicious()