Lines Matching refs:curr
1927 struct task_struct *curr = current; in print_circular_bug_header() local
1938 curr->comm, task_pid_nr(curr)); in print_circular_bug_header()
2017 struct task_struct *curr = current; in print_circular_bug() local
2045 lockdep_print_held_locks(curr); in print_circular_bug()
2537 print_bad_irq_dependency(struct task_struct *curr, in print_bad_irq_dependency() argument
2558 curr->comm, task_pid_nr(curr), in print_bad_irq_dependency()
2560 curr->softirq_context, softirq_count() >> SOFTIRQ_SHIFT, in print_bad_irq_dependency()
2562 curr->softirqs_enabled); in print_bad_irq_dependency()
2591 lockdep_print_held_locks(curr); in print_bad_irq_dependency()
2766 static int check_irq_usage(struct task_struct *curr, struct held_lock *prev, in check_irq_usage() argument
2843 print_bad_irq_dependency(curr, &this, &that, in check_irq_usage()
2854 static inline int check_irq_usage(struct task_struct *curr, in check_irq_usage() argument
2961 print_deadlock_bug(struct task_struct *curr, struct held_lock *prev, in print_deadlock_bug() argument
2973 curr->comm, task_pid_nr(curr)); in print_deadlock_bug()
2980 lockdep_print_held_locks(curr); in print_deadlock_bug()
2997 check_deadlock(struct task_struct *curr, struct held_lock *next) in check_deadlock() argument
3003 for (i = 0; i < curr->lockdep_depth; i++) { in check_deadlock()
3004 prev = curr->held_locks + i; in check_deadlock()
3026 print_deadlock_bug(curr, prev, next); in check_deadlock()
3055 check_prev_add(struct task_struct *curr, struct held_lock *prev, in check_prev_add() argument
3094 if (!check_irq_usage(curr, prev, next)) in check_prev_add()
3183 check_prevs_add(struct task_struct *curr, struct held_lock *next) in check_prevs_add() argument
3186 int depth = curr->lockdep_depth; in check_prevs_add()
3200 if (curr->held_locks[depth].irq_context != in check_prevs_add()
3201 curr->held_locks[depth-1].irq_context) in check_prevs_add()
3205 u16 distance = curr->lockdep_depth - depth + 1; in check_prevs_add()
3206 hlock = curr->held_locks + depth - 1; in check_prevs_add()
3209 int ret = check_prev_add(curr, hlock, next, distance, &trace); in check_prevs_add()
3232 if (curr->held_locks[depth].irq_context != in check_prevs_add()
3233 curr->held_locks[depth-1].irq_context) in check_prevs_add()
3293 #define for_each_chain_block(bucket, prev, curr) \ argument
3294 for ((prev) = -1, (curr) = chain_block_buckets[bucket]; \
3295 (curr) >= 0; \
3296 (prev) = (curr), (curr) = chain_block_next(curr))
3340 int prev, curr; in add_chain_block() local
3362 for_each_chain_block(0, prev, curr) { in add_chain_block()
3363 if (size >= chain_block_size(curr)) in add_chain_block()
3366 init_chain_block(offset, curr, 0, size); in add_chain_block()
3418 int bucket, curr, size; in alloc_chain_hlocks() local
3437 curr = chain_block_buckets[bucket]; in alloc_chain_hlocks()
3440 if (curr >= 0) { in alloc_chain_hlocks()
3441 del_chain_block(bucket, req, chain_block_next(curr)); in alloc_chain_hlocks()
3442 return curr; in alloc_chain_hlocks()
3445 curr = chain_block_buckets[0]; in alloc_chain_hlocks()
3452 if (curr >= 0) { in alloc_chain_hlocks()
3453 size = chain_block_size(curr); in alloc_chain_hlocks()
3455 del_chain_block(0, size, chain_block_next(curr)); in alloc_chain_hlocks()
3457 add_chain_block(curr + req, size - req); in alloc_chain_hlocks()
3458 return curr; in alloc_chain_hlocks()
3467 curr = chain_block_buckets[bucket]; in alloc_chain_hlocks()
3468 if (curr < 0) in alloc_chain_hlocks()
3471 del_chain_block(bucket, size, chain_block_next(curr)); in alloc_chain_hlocks()
3472 add_chain_block(curr + req, size - req); in alloc_chain_hlocks()
3473 return curr; in alloc_chain_hlocks()
3495 static inline int get_first_held_lock(struct task_struct *curr, in get_first_held_lock() argument
3501 for (i = curr->lockdep_depth - 1; i >= 0; i--) { in get_first_held_lock()
3502 hlock_curr = curr->held_locks + i; in get_first_held_lock()
3526 print_chain_keys_held_locks(struct task_struct *curr, struct held_lock *hlock_next) in print_chain_keys_held_locks() argument
3530 int depth = curr->lockdep_depth; in print_chain_keys_held_locks()
3531 int i = get_first_held_lock(curr, hlock_next); in print_chain_keys_held_locks()
3536 hlock = curr->held_locks + i; in print_chain_keys_held_locks()
3562 static void print_collision(struct task_struct *curr, in print_collision() argument
3575 print_chain_keys_held_locks(curr, hlock_next); in print_collision()
3591 static int check_no_collision(struct task_struct *curr, in check_no_collision() argument
3598 i = get_first_held_lock(curr, hlock); in check_no_collision()
3600 if (DEBUG_LOCKS_WARN_ON(chain->depth != curr->lockdep_depth - (i - 1))) { in check_no_collision()
3601 print_collision(curr, hlock, chain); in check_no_collision()
3606 id = hlock_id(&curr->held_locks[i]); in check_no_collision()
3609 print_collision(curr, hlock, chain); in check_no_collision()
3651 static inline int add_chain_cache(struct task_struct *curr, in add_chain_cache() argument
3678 i = get_first_held_lock(curr, hlock); in add_chain_cache()
3679 chain->depth = curr->lockdep_depth + 1 - i; in add_chain_cache()
3682 BUILD_BUG_ON((1UL << 6) <= ARRAY_SIZE(curr->held_locks)); in add_chain_cache()
3697 int lock_id = hlock_id(curr->held_locks + i); in add_chain_cache()
3733 static inline int lookup_chain_cache_add(struct task_struct *curr, in lookup_chain_cache_add() argument
3742 if (!check_no_collision(curr, hlock, chain)) in lookup_chain_cache_add()
3772 if (!add_chain_cache(curr, hlock, chain_key)) in lookup_chain_cache_add()
3778 static int validate_chain(struct task_struct *curr, in validate_chain() argument
3793 lookup_chain_cache_add(curr, hlock, chain_key)) { in validate_chain()
3812 int ret = check_deadlock(curr, hlock); in validate_chain()
3825 if (!check_prevs_add(curr, hlock)) in validate_chain()
3839 static inline int validate_chain(struct task_struct *curr, in validate_chain() argument
3853 static void check_chain_key(struct task_struct *curr) in check_chain_key() argument
3860 for (i = 0; i < curr->lockdep_depth; i++) { in check_chain_key()
3861 hlock = curr->held_locks + i; in check_chain_key()
3869 curr->lockdep_depth, i, in check_chain_key()
3888 if (chain_key != curr->curr_chain_key) { in check_chain_key()
3895 curr->lockdep_depth, i, in check_chain_key()
3897 (unsigned long long)curr->curr_chain_key); in check_chain_key()
3903 static int mark_lock(struct task_struct *curr, struct held_lock *this,
3924 print_usage_bug(struct task_struct *curr, struct held_lock *this, in print_usage_bug() argument
3940 curr->comm, task_pid_nr(curr), in print_usage_bug()
3942 lockdep_softirq_context(curr), softirq_count() >> SOFTIRQ_SHIFT, in print_usage_bug()
3944 lockdep_softirqs_enabled(curr)); in print_usage_bug()
3950 print_irqtrace_events(curr); in print_usage_bug()
3954 lockdep_print_held_locks(curr); in print_usage_bug()
3964 valid_state(struct task_struct *curr, struct held_lock *this, in valid_state() argument
3969 print_usage_bug(curr, this, bad_bit, new_bit); in valid_state()
3980 print_irq_inversion_bug(struct task_struct *curr, in print_irq_inversion_bug() argument
3998 curr->comm, task_pid_nr(curr)); in print_irq_inversion_bug()
4027 lockdep_print_held_locks(curr); in print_irq_inversion_bug()
4044 check_usage_forwards(struct task_struct *curr, struct held_lock *this, in check_usage_forwards() argument
4064 print_irq_inversion_bug(curr, &root, target_entry, in check_usage_forwards()
4067 print_irq_inversion_bug(curr, &root, target_entry, in check_usage_forwards()
4079 check_usage_backwards(struct task_struct *curr, struct held_lock *this, in check_usage_backwards() argument
4099 print_irq_inversion_bug(curr, &root, target_entry, in check_usage_backwards()
4102 print_irq_inversion_bug(curr, &root, target_entry, in check_usage_backwards()
4109 void print_irqtrace_events(struct task_struct *curr) in print_irqtrace_events() argument
4111 const struct irqtrace_events *trace = &curr->irqtrace; in print_irqtrace_events()
4161 mark_lock_irq(struct task_struct *curr, struct held_lock *this, in mark_lock_irq() argument
4172 if (!valid_state(curr, this, new_bit, excl_bit)) in mark_lock_irq()
4178 if (!read && !valid_state(curr, this, new_bit, in mark_lock_irq()
4192 if (!check_usage_backwards(curr, this, excl_bit)) in mark_lock_irq()
4199 if (!check_usage_forwards(curr, this, excl_bit)) in mark_lock_irq()
4213 mark_held_locks(struct task_struct *curr, enum lock_usage_bit base_bit) in mark_held_locks() argument
4218 for (i = 0; i < curr->lockdep_depth; i++) { in mark_held_locks()
4220 hlock = curr->held_locks + i; in mark_held_locks()
4230 if (!mark_lock(curr, hlock, hlock_bit)) in mark_held_locks()
4242 struct task_struct *curr = current; in __trace_hardirqs_on_caller() local
4248 if (!mark_held_locks(curr, LOCK_ENABLED_HARDIRQ)) in __trace_hardirqs_on_caller()
4255 if (curr->softirqs_enabled) in __trace_hardirqs_on_caller()
4256 mark_held_locks(curr, LOCK_ENABLED_SOFTIRQ); in __trace_hardirqs_on_caller()
4499 mark_usage(struct task_struct *curr, struct held_lock *hlock, int check) in mark_usage() argument
4511 if (!mark_lock(curr, hlock, in mark_usage()
4514 if (curr->softirq_context) in mark_usage()
4515 if (!mark_lock(curr, hlock, in mark_usage()
4520 if (!mark_lock(curr, hlock, LOCK_USED_IN_HARDIRQ)) in mark_usage()
4522 if (curr->softirq_context) in mark_usage()
4523 if (!mark_lock(curr, hlock, LOCK_USED_IN_SOFTIRQ)) in mark_usage()
4529 if (!mark_lock(curr, hlock, in mark_usage()
4532 if (curr->softirqs_enabled) in mark_usage()
4533 if (!mark_lock(curr, hlock, in mark_usage()
4537 if (!mark_lock(curr, hlock, in mark_usage()
4540 if (curr->softirqs_enabled) in mark_usage()
4541 if (!mark_lock(curr, hlock, in mark_usage()
4549 if (!mark_lock(curr, hlock, LOCK_USED)) in mark_usage()
4561 static int separate_irq_context(struct task_struct *curr, in separate_irq_context() argument
4564 unsigned int depth = curr->lockdep_depth; in separate_irq_context()
4572 prev_hlock = curr->held_locks + depth-1; in separate_irq_context()
4587 static int mark_lock(struct task_struct *curr, struct held_lock *this, in mark_lock() argument
4628 ret = mark_lock_irq(curr, this, new_bit); in mark_lock()
4642 print_irqtrace_events(curr); in mark_lock()
4649 static inline short task_wait_context(struct task_struct *curr) in task_wait_context() argument
4659 if (curr->hardirq_threaded || curr->irq_config) in task_wait_context()
4663 } else if (curr->softirq_context) { in task_wait_context()
4674 print_lock_invalid_wait_context(struct task_struct *curr, in print_lock_invalid_wait_context() argument
4690 pr_warn("%s/%d is trying to lock:\n", curr->comm, task_pid_nr(curr)); in print_lock_invalid_wait_context()
4695 curr_inner = task_wait_context(curr); in print_lock_invalid_wait_context()
4698 lockdep_print_held_locks(curr); in print_lock_invalid_wait_context()
4721 static int check_wait_context(struct task_struct *curr, struct held_lock *next) in check_wait_context() argument
4737 for (depth = curr->lockdep_depth - 1; depth >= 0; depth--) { in check_wait_context()
4738 struct held_lock *prev = curr->held_locks + depth; in check_wait_context()
4744 curr_inner = task_wait_context(curr); in check_wait_context()
4746 for (; depth < curr->lockdep_depth; depth++) { in check_wait_context()
4747 struct held_lock *prev = curr->held_locks + depth; in check_wait_context()
4762 return print_lock_invalid_wait_context(curr, next); in check_wait_context()
4770 mark_usage(struct task_struct *curr, struct held_lock *hlock, int check) in mark_usage() argument
4780 static inline int separate_irq_context(struct task_struct *curr, in separate_irq_context() argument
4786 static inline int check_wait_context(struct task_struct *curr, in check_wait_context() argument
4863 print_lock_nested_lock_not_held(struct task_struct *curr, in print_lock_nested_lock_not_held() argument
4877 pr_warn("%s/%d is trying to lock:\n", curr->comm, task_pid_nr(curr)); in print_lock_nested_lock_not_held()
4887 lockdep_print_held_locks(curr); in print_lock_nested_lock_not_held()
4908 struct task_struct *curr = current; in __lock_acquire() local
4948 depth = curr->lockdep_depth; in __lock_acquire()
4958 hlock = curr->held_locks + depth - 1; in __lock_acquire()
4976 hlock = curr->held_locks + depth; in __lock_acquire()
4987 hlock->irq_context = task_irq_context(curr); in __lock_acquire()
4999 if (check_wait_context(curr, hlock)) in __lock_acquire()
5003 if (!mark_usage(curr, hlock, check)) in __lock_acquire()
5022 chain_key = curr->curr_chain_key; in __lock_acquire()
5033 if (separate_irq_context(curr, hlock)) { in __lock_acquire()
5040 print_lock_nested_lock_not_held(curr, hlock); in __lock_acquire()
5049 if (!validate_chain(curr, hlock, chain_head, chain_key)) in __lock_acquire()
5052 curr->curr_chain_key = chain_key; in __lock_acquire()
5053 curr->lockdep_depth++; in __lock_acquire()
5054 check_chain_key(curr); in __lock_acquire()
5059 if (unlikely(curr->lockdep_depth >= MAX_LOCK_DEPTH)) { in __lock_acquire()
5063 curr->lockdep_depth, MAX_LOCK_DEPTH); in __lock_acquire()
5072 if (unlikely(curr->lockdep_depth > max_lockdep_depth)) in __lock_acquire()
5073 max_lockdep_depth = curr->lockdep_depth; in __lock_acquire()
5078 static void print_unlock_imbalance_bug(struct task_struct *curr, in print_unlock_imbalance_bug() argument
5093 curr->comm, task_pid_nr(curr)); in print_unlock_imbalance_bug()
5099 lockdep_print_held_locks(curr); in print_unlock_imbalance_bug()
5142 static struct held_lock *find_held_lock(struct task_struct *curr, in find_held_lock() argument
5150 hlock = curr->held_locks + i; in find_held_lock()
5177 static int reacquire_held_locks(struct task_struct *curr, unsigned int depth, in reacquire_held_locks() argument
5186 for (hlock = curr->held_locks + idx; idx < depth; idx++, hlock++) { in reacquire_held_locks()
5214 struct task_struct *curr = current; in __lock_set_class() local
5223 depth = curr->lockdep_depth; in __lock_set_class()
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()
5244 curr->lockdep_depth = i; in __lock_set_class()
5245 curr->curr_chain_key = hlock->prev_chain_key; in __lock_set_class()
5247 if (reacquire_held_locks(curr, depth, i, &merged)) in __lock_set_class()
5254 if (DEBUG_LOCKS_WARN_ON(curr->lockdep_depth != depth - merged)) in __lock_set_class()
5261 struct task_struct *curr = current; in __lock_downgrade() local
5269 depth = curr->lockdep_depth; in __lock_downgrade()
5277 hlock = find_held_lock(curr, lock, depth, &i); in __lock_downgrade()
5279 print_unlock_imbalance_bug(curr, lock, ip); in __lock_downgrade()
5283 curr->lockdep_depth = i; in __lock_downgrade()
5284 curr->curr_chain_key = hlock->prev_chain_key; in __lock_downgrade()
5290 if (reacquire_held_locks(curr, depth, i, &merged)) in __lock_downgrade()
5301 if (DEBUG_LOCKS_WARN_ON(curr->lockdep_depth != depth)) in __lock_downgrade()
5315 struct task_struct *curr = current; in __lock_release() local
5323 depth = curr->lockdep_depth; in __lock_release()
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()
5366 curr->lockdep_depth = i; in __lock_release()
5367 curr->curr_chain_key = hlock->prev_chain_key; in __lock_release()
5376 if (reacquire_held_locks(curr, depth, i + 1, &merged)) in __lock_release()
5384 DEBUG_LOCKS_WARN_ON(curr->lockdep_depth != depth - merged); in __lock_release()
5397 struct task_struct *curr = current; in __lock_is_held() local
5400 for (i = 0; i < curr->lockdep_depth; i++) { in __lock_is_held()
5401 struct held_lock *hlock = curr->held_locks + i; in __lock_is_held()
5417 struct task_struct *curr = current; in __lock_pin_lock() local
5423 for (i = 0; i < curr->lockdep_depth; i++) { in __lock_pin_lock()
5424 struct held_lock *hlock = curr->held_locks + i; in __lock_pin_lock()
5444 struct task_struct *curr = current; in __lock_repin_lock() local
5450 for (i = 0; i < curr->lockdep_depth; i++) { in __lock_repin_lock()
5451 struct held_lock *hlock = curr->held_locks + i; in __lock_repin_lock()
5464 struct task_struct *curr = current; in __lock_unpin_lock() local
5470 for (i = 0; i < curr->lockdep_depth; i++) { in __lock_unpin_lock()
5471 struct held_lock *hlock = curr->held_locks + i; in __lock_unpin_lock()
5769 static void print_lock_contention_bug(struct task_struct *curr, in print_lock_contention_bug() argument
5784 curr->comm, task_pid_nr(curr)); in print_lock_contention_bug()
5790 lockdep_print_held_locks(curr); in print_lock_contention_bug()
5799 struct task_struct *curr = current; in __lock_contended() local
5805 depth = curr->lockdep_depth; in __lock_contended()
5813 hlock = find_held_lock(curr, lock, depth, &i); in __lock_contended()
5815 print_lock_contention_bug(curr, lock, ip); in __lock_contended()
5840 struct task_struct *curr = current; in __lock_acquired() local
5847 depth = curr->lockdep_depth; in __lock_acquired()
5855 hlock = find_held_lock(curr, lock, depth, &i); in __lock_acquired()
5857 print_lock_contention_bug(curr, lock, _RET_IP_); in __lock_acquired()
6399 print_freed_lock_bug(struct task_struct *curr, const void *mem_from, in print_freed_lock_bug() argument
6413 curr->comm, task_pid_nr(curr), mem_from, mem_to-1); in print_freed_lock_bug()
6415 lockdep_print_held_locks(curr); in print_freed_lock_bug()
6435 struct task_struct *curr = current; in debug_check_no_locks_freed() local
6444 for (i = 0; i < curr->lockdep_depth; i++) { in debug_check_no_locks_freed()
6445 hlock = curr->held_locks + i; in debug_check_no_locks_freed()
6451 print_freed_lock_bug(curr, mem_from, mem_from + mem_len, hlock); in debug_check_no_locks_freed()
6526 struct task_struct *curr = current; in lockdep_sys_exit() local
6528 if (unlikely(curr->lockdep_depth)) { in lockdep_sys_exit()
6537 curr->comm, curr->pid); in lockdep_sys_exit()
6538 lockdep_print_held_locks(curr); in lockdep_sys_exit()
6550 struct task_struct *curr = current; in lockdep_rcu_suspicious() local
6590 lockdep_print_held_locks(curr); in lockdep_rcu_suspicious()