aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/lockdep.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-10-26 10:26:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-26 10:26:53 -0400
commit19b4a8d520a6e0176dd52aaa429261ad4fcaa545 (patch)
tree6dcf5a780718fc50b9cd79cc803daa7c7e080a02 /kernel/lockdep.c
parent3cfef9524677a4ecb392d6fbffe6ebce6302f1d4 (diff)
parent048b718029033af117870d3da47da12995be14a3 (diff)
Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (45 commits) rcu: Move propagation of ->completed from rcu_start_gp() to rcu_report_qs_rsp() rcu: Remove rcu_needs_cpu_flush() to avoid false quiescent states rcu: Wire up RCU_BOOST_PRIO for rcutree rcu: Make rcu_torture_boost() exit loops at end of test rcu: Make rcu_torture_fqs() exit loops at end of test rcu: Permit rt_mutex_unlock() with irqs disabled rcu: Avoid having just-onlined CPU resched itself when RCU is idle rcu: Suppress NMI backtraces when stall ends before dump rcu: Prohibit grace periods during early boot rcu: Simplify unboosting checks rcu: Prevent early boot set_need_resched() from __rcu_pending() rcu: Dump local stack if cannot dump all CPUs' stacks rcu: Move __rcu_read_unlock()'s barrier() within if-statement rcu: Improve rcu_assign_pointer() and RCU_INIT_POINTER() documentation rcu: Make rcu_assign_pointer() unconditionally insert a memory barrier rcu: Make rcu_implicit_dynticks_qs() locals be correct size rcu: Eliminate in_irq() checks in rcu_enter_nohz() nohz: Remove nohz_cpu_mask rcu: Document interpretation of RCU-lockdep splats rcu: Allow rcutorture's stat_interval parameter to be changed at runtime ...
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r--kernel/lockdep.c84
1 files changed, 47 insertions, 37 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index c081fa967c8f..e69434b070da 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -1145,10 +1145,11 @@ print_circular_bug_header(struct lock_list *entry, unsigned int depth,
1145 if (debug_locks_silent) 1145 if (debug_locks_silent)
1146 return 0; 1146 return 0;
1147 1147
1148 printk("\n=======================================================\n"); 1148 printk("\n");
1149 printk( "[ INFO: possible circular locking dependency detected ]\n"); 1149 printk("======================================================\n");
1150 printk("[ INFO: possible circular locking dependency detected ]\n");
1150 print_kernel_version(); 1151 print_kernel_version();
1151 printk( "-------------------------------------------------------\n"); 1152 printk("-------------------------------------------------------\n");
1152 printk("%s/%d is trying to acquire lock:\n", 1153 printk("%s/%d is trying to acquire lock:\n",
1153 curr->comm, task_pid_nr(curr)); 1154 curr->comm, task_pid_nr(curr));
1154 print_lock(check_src); 1155 print_lock(check_src);
@@ -1482,11 +1483,12 @@ print_bad_irq_dependency(struct task_struct *curr,
1482 if (!debug_locks_off_graph_unlock() || debug_locks_silent) 1483 if (!debug_locks_off_graph_unlock() || debug_locks_silent)
1483 return 0; 1484 return 0;
1484 1485
1485 printk("\n======================================================\n"); 1486 printk("\n");
1486 printk( "[ INFO: %s-safe -> %s-unsafe lock order detected ]\n", 1487 printk("======================================================\n");
1488 printk("[ INFO: %s-safe -> %s-unsafe lock order detected ]\n",
1487 irqclass, irqclass); 1489 irqclass, irqclass);
1488 print_kernel_version(); 1490 print_kernel_version();
1489 printk( "------------------------------------------------------\n"); 1491 printk("------------------------------------------------------\n");
1490 printk("%s/%d [HC%u[%lu]:SC%u[%lu]:HE%u:SE%u] is trying to acquire:\n", 1492 printk("%s/%d [HC%u[%lu]:SC%u[%lu]:HE%u:SE%u] is trying to acquire:\n",
1491 curr->comm, task_pid_nr(curr), 1493 curr->comm, task_pid_nr(curr),
1492 curr->hardirq_context, hardirq_count() >> HARDIRQ_SHIFT, 1494 curr->hardirq_context, hardirq_count() >> HARDIRQ_SHIFT,
@@ -1711,10 +1713,11 @@ print_deadlock_bug(struct task_struct *curr, struct held_lock *prev,
1711 if (!debug_locks_off_graph_unlock() || debug_locks_silent) 1713 if (!debug_locks_off_graph_unlock() || debug_locks_silent)
1712 return 0; 1714 return 0;
1713 1715
1714 printk("\n=============================================\n"); 1716 printk("\n");
1715 printk( "[ INFO: possible recursive locking detected ]\n"); 1717 printk("=============================================\n");
1718 printk("[ INFO: possible recursive locking detected ]\n");
1716 print_kernel_version(); 1719 print_kernel_version();
1717 printk( "---------------------------------------------\n"); 1720 printk("---------------------------------------------\n");
1718 printk("%s/%d is trying to acquire lock:\n", 1721 printk("%s/%d is trying to acquire lock:\n",
1719 curr->comm, task_pid_nr(curr)); 1722 curr->comm, task_pid_nr(curr));
1720 print_lock(next); 1723 print_lock(next);
@@ -2217,10 +2220,11 @@ print_usage_bug(struct task_struct *curr, struct held_lock *this,
2217 if (!debug_locks_off_graph_unlock() || debug_locks_silent) 2220 if (!debug_locks_off_graph_unlock() || debug_locks_silent)
2218 return 0; 2221 return 0;
2219 2222
2220 printk("\n=================================\n"); 2223 printk("\n");
2221 printk( "[ INFO: inconsistent lock state ]\n"); 2224 printk("=================================\n");
2225 printk("[ INFO: inconsistent lock state ]\n");
2222 print_kernel_version(); 2226 print_kernel_version();
2223 printk( "---------------------------------\n"); 2227 printk("---------------------------------\n");
2224 2228
2225 printk("inconsistent {%s} -> {%s} usage.\n", 2229 printk("inconsistent {%s} -> {%s} usage.\n",
2226 usage_str[prev_bit], usage_str[new_bit]); 2230 usage_str[prev_bit], usage_str[new_bit]);
@@ -2281,10 +2285,11 @@ print_irq_inversion_bug(struct task_struct *curr,
2281 if (!debug_locks_off_graph_unlock() || debug_locks_silent) 2285 if (!debug_locks_off_graph_unlock() || debug_locks_silent)
2282 return 0; 2286 return 0;
2283 2287
2284 printk("\n=========================================================\n"); 2288 printk("\n");
2285 printk( "[ INFO: possible irq lock inversion dependency detected ]\n"); 2289 printk("=========================================================\n");
2290 printk("[ INFO: possible irq lock inversion dependency detected ]\n");
2286 print_kernel_version(); 2291 print_kernel_version();
2287 printk( "---------------------------------------------------------\n"); 2292 printk("---------------------------------------------------------\n");
2288 printk("%s/%d just changed the state of lock:\n", 2293 printk("%s/%d just changed the state of lock:\n",
2289 curr->comm, task_pid_nr(curr)); 2294 curr->comm, task_pid_nr(curr));
2290 print_lock(this); 2295 print_lock(this);
@@ -3161,9 +3166,10 @@ print_unlock_inbalance_bug(struct task_struct *curr, struct lockdep_map *lock,
3161 if (debug_locks_silent) 3166 if (debug_locks_silent)
3162 return 0; 3167 return 0;
3163 3168
3164 printk("\n=====================================\n"); 3169 printk("\n");
3165 printk( "[ BUG: bad unlock balance detected! ]\n"); 3170 printk("=====================================\n");
3166 printk( "-------------------------------------\n"); 3171 printk("[ BUG: bad unlock balance detected! ]\n");
3172 printk("-------------------------------------\n");
3167 printk("%s/%d is trying to release lock (", 3173 printk("%s/%d is trying to release lock (",
3168 curr->comm, task_pid_nr(curr)); 3174 curr->comm, task_pid_nr(curr));
3169 print_lockdep_cache(lock); 3175 print_lockdep_cache(lock);
@@ -3604,9 +3610,10 @@ print_lock_contention_bug(struct task_struct *curr, struct lockdep_map *lock,
3604 if (debug_locks_silent) 3610 if (debug_locks_silent)
3605 return 0; 3611 return 0;
3606 3612
3607 printk("\n=================================\n"); 3613 printk("\n");
3608 printk( "[ BUG: bad contention detected! ]\n"); 3614 printk("=================================\n");
3609 printk( "---------------------------------\n"); 3615 printk("[ BUG: bad contention detected! ]\n");
3616 printk("---------------------------------\n");
3610 printk("%s/%d is trying to contend lock (", 3617 printk("%s/%d is trying to contend lock (",
3611 curr->comm, task_pid_nr(curr)); 3618 curr->comm, task_pid_nr(curr));
3612 print_lockdep_cache(lock); 3619 print_lockdep_cache(lock);
@@ -3977,9 +3984,10 @@ print_freed_lock_bug(struct task_struct *curr, const void *mem_from,
3977 if (debug_locks_silent) 3984 if (debug_locks_silent)
3978 return; 3985 return;
3979 3986
3980 printk("\n=========================\n"); 3987 printk("\n");
3981 printk( "[ BUG: held lock freed! ]\n"); 3988 printk("=========================\n");
3982 printk( "-------------------------\n"); 3989 printk("[ BUG: held lock freed! ]\n");
3990 printk("-------------------------\n");
3983 printk("%s/%d is freeing memory %p-%p, with a lock still held there!\n", 3991 printk("%s/%d is freeing memory %p-%p, with a lock still held there!\n",
3984 curr->comm, task_pid_nr(curr), mem_from, mem_to-1); 3992 curr->comm, task_pid_nr(curr), mem_from, mem_to-1);
3985 print_lock(hlock); 3993 print_lock(hlock);
@@ -4033,9 +4041,10 @@ static void print_held_locks_bug(struct task_struct *curr)
4033 if (debug_locks_silent) 4041 if (debug_locks_silent)
4034 return; 4042 return;
4035 4043
4036 printk("\n=====================================\n"); 4044 printk("\n");
4037 printk( "[ BUG: lock held at task exit time! ]\n"); 4045 printk("=====================================\n");
4038 printk( "-------------------------------------\n"); 4046 printk("[ BUG: lock held at task exit time! ]\n");
4047 printk("-------------------------------------\n");
4039 printk("%s/%d is exiting with locks still held!\n", 4048 printk("%s/%d is exiting with locks still held!\n",
4040 curr->comm, task_pid_nr(curr)); 4049 curr->comm, task_pid_nr(curr));
4041 lockdep_print_held_locks(curr); 4050 lockdep_print_held_locks(curr);
@@ -4129,16 +4138,17 @@ void lockdep_sys_exit(void)
4129 if (unlikely(curr->lockdep_depth)) { 4138 if (unlikely(curr->lockdep_depth)) {
4130 if (!debug_locks_off()) 4139 if (!debug_locks_off())
4131 return; 4140 return;
4132 printk("\n================================================\n"); 4141 printk("\n");
4133 printk( "[ BUG: lock held when returning to user space! ]\n"); 4142 printk("================================================\n");
4134 printk( "------------------------------------------------\n"); 4143 printk("[ BUG: lock held when returning to user space! ]\n");
4144 printk("------------------------------------------------\n");
4135 printk("%s/%d is leaving the kernel with locks still held!\n", 4145 printk("%s/%d is leaving the kernel with locks still held!\n",
4136 curr->comm, curr->pid); 4146 curr->comm, curr->pid);
4137 lockdep_print_held_locks(curr); 4147 lockdep_print_held_locks(curr);
4138 } 4148 }
4139} 4149}
4140 4150
4141void lockdep_rcu_dereference(const char *file, const int line) 4151void lockdep_rcu_suspicious(const char *file, const int line, const char *s)
4142{ 4152{
4143 struct task_struct *curr = current; 4153 struct task_struct *curr = current;
4144 4154
@@ -4147,15 +4157,15 @@ void lockdep_rcu_dereference(const char *file, const int line)
4147 return; 4157 return;
4148#endif /* #ifdef CONFIG_PROVE_RCU_REPEATEDLY */ 4158#endif /* #ifdef CONFIG_PROVE_RCU_REPEATEDLY */
4149 /* Note: the following can be executed concurrently, so be careful. */ 4159 /* Note: the following can be executed concurrently, so be careful. */
4150 printk("\n===================================================\n"); 4160 printk("\n");
4151 printk( "[ INFO: suspicious rcu_dereference_check() usage. ]\n"); 4161 printk("===============================\n");
4152 printk( "---------------------------------------------------\n"); 4162 printk("[ INFO: suspicious RCU usage. ]\n");
4153 printk("%s:%d invoked rcu_dereference_check() without protection!\n", 4163 printk("-------------------------------\n");
4154 file, line); 4164 printk("%s:%d %s!\n", file, line, s);
4155 printk("\nother info that might help us debug this:\n\n"); 4165 printk("\nother info that might help us debug this:\n\n");
4156 printk("\nrcu_scheduler_active = %d, debug_locks = %d\n", rcu_scheduler_active, debug_locks); 4166 printk("\nrcu_scheduler_active = %d, debug_locks = %d\n", rcu_scheduler_active, debug_locks);
4157 lockdep_print_held_locks(curr); 4167 lockdep_print_held_locks(curr);
4158 printk("\nstack backtrace:\n"); 4168 printk("\nstack backtrace:\n");
4159 dump_stack(); 4169 dump_stack();
4160} 4170}
4161EXPORT_SYMBOL_GPL(lockdep_rcu_dereference); 4171EXPORT_SYMBOL_GPL(lockdep_rcu_suspicious);