aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2011-10-27 23:36:55 -0400
committerIngo Molnar <mingo@elte.hu>2011-12-06 02:16:49 -0500
commitfbdc4b9a6c29befbcca65e5366e5aaf2abb7a013 (patch)
treeda6f6fbf2bfb552b2dd58559bf059a5359510b41
parentdf754e6af2f237a6c020c0daff55a1a609338e31 (diff)
lockdep, rtmutex, bug: Show taint flags on error
Show the taint flags in all lockdep and rtmutex-debug error messages. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1319773015.6759.30.camel@deadeye Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/lockdep.c23
-rw-r--r--kernel/rtmutex-debug.c1
2 files changed, 16 insertions, 8 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 103bed8423f..a2ab30c12af 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -567,11 +567,12 @@ static void lockdep_print_held_locks(struct task_struct *curr)
567 } 567 }
568} 568}
569 569
570static void print_kernel_version(void) 570static void print_kernel_ident(void)
571{ 571{
572 printk("%s %.*s\n", init_utsname()->release, 572 printk("%s %.*s %s\n", init_utsname()->release,
573 (int)strcspn(init_utsname()->version, " "), 573 (int)strcspn(init_utsname()->version, " "),
574 init_utsname()->version); 574 init_utsname()->version,
575 print_tainted());
575} 576}
576 577
577static int very_verbose(struct lock_class *class) 578static int very_verbose(struct lock_class *class)
@@ -1149,7 +1150,7 @@ print_circular_bug_header(struct lock_list *entry, unsigned int depth,
1149 printk("\n"); 1150 printk("\n");
1150 printk("======================================================\n"); 1151 printk("======================================================\n");
1151 printk("[ INFO: possible circular locking dependency detected ]\n"); 1152 printk("[ INFO: possible circular locking dependency detected ]\n");
1152 print_kernel_version(); 1153 print_kernel_ident();
1153 printk("-------------------------------------------------------\n"); 1154 printk("-------------------------------------------------------\n");
1154 printk("%s/%d is trying to acquire lock:\n", 1155 printk("%s/%d is trying to acquire lock:\n",
1155 curr->comm, task_pid_nr(curr)); 1156 curr->comm, task_pid_nr(curr));
@@ -1488,7 +1489,7 @@ print_bad_irq_dependency(struct task_struct *curr,
1488 printk("======================================================\n"); 1489 printk("======================================================\n");
1489 printk("[ INFO: %s-safe -> %s-unsafe lock order detected ]\n", 1490 printk("[ INFO: %s-safe -> %s-unsafe lock order detected ]\n",
1490 irqclass, irqclass); 1491 irqclass, irqclass);
1491 print_kernel_version(); 1492 print_kernel_ident();
1492 printk("------------------------------------------------------\n"); 1493 printk("------------------------------------------------------\n");
1493 printk("%s/%d [HC%u[%lu]:SC%u[%lu]:HE%u:SE%u] is trying to acquire:\n", 1494 printk("%s/%d [HC%u[%lu]:SC%u[%lu]:HE%u:SE%u] is trying to acquire:\n",
1494 curr->comm, task_pid_nr(curr), 1495 curr->comm, task_pid_nr(curr),
@@ -1717,7 +1718,7 @@ print_deadlock_bug(struct task_struct *curr, struct held_lock *prev,
1717 printk("\n"); 1718 printk("\n");
1718 printk("=============================================\n"); 1719 printk("=============================================\n");
1719 printk("[ INFO: possible recursive locking detected ]\n"); 1720 printk("[ INFO: possible recursive locking detected ]\n");
1720 print_kernel_version(); 1721 print_kernel_ident();
1721 printk("---------------------------------------------\n"); 1722 printk("---------------------------------------------\n");
1722 printk("%s/%d is trying to acquire lock:\n", 1723 printk("%s/%d is trying to acquire lock:\n",
1723 curr->comm, task_pid_nr(curr)); 1724 curr->comm, task_pid_nr(curr));
@@ -2224,7 +2225,7 @@ print_usage_bug(struct task_struct *curr, struct held_lock *this,
2224 printk("\n"); 2225 printk("\n");
2225 printk("=================================\n"); 2226 printk("=================================\n");
2226 printk("[ INFO: inconsistent lock state ]\n"); 2227 printk("[ INFO: inconsistent lock state ]\n");
2227 print_kernel_version(); 2228 print_kernel_ident();
2228 printk("---------------------------------\n"); 2229 printk("---------------------------------\n");
2229 2230
2230 printk("inconsistent {%s} -> {%s} usage.\n", 2231 printk("inconsistent {%s} -> {%s} usage.\n",
@@ -2289,7 +2290,7 @@ print_irq_inversion_bug(struct task_struct *curr,
2289 printk("\n"); 2290 printk("\n");
2290 printk("=========================================================\n"); 2291 printk("=========================================================\n");
2291 printk("[ INFO: possible irq lock inversion dependency detected ]\n"); 2292 printk("[ INFO: possible irq lock inversion dependency detected ]\n");
2292 print_kernel_version(); 2293 print_kernel_ident();
2293 printk("---------------------------------------------------------\n"); 2294 printk("---------------------------------------------------------\n");
2294 printk("%s/%d just changed the state of lock:\n", 2295 printk("%s/%d just changed the state of lock:\n",
2295 curr->comm, task_pid_nr(curr)); 2296 curr->comm, task_pid_nr(curr));
@@ -3170,6 +3171,7 @@ print_unlock_inbalance_bug(struct task_struct *curr, struct lockdep_map *lock,
3170 printk("\n"); 3171 printk("\n");
3171 printk("=====================================\n"); 3172 printk("=====================================\n");
3172 printk("[ BUG: bad unlock balance detected! ]\n"); 3173 printk("[ BUG: bad unlock balance detected! ]\n");
3174 print_kernel_ident();
3173 printk("-------------------------------------\n"); 3175 printk("-------------------------------------\n");
3174 printk("%s/%d is trying to release lock (", 3176 printk("%s/%d is trying to release lock (",
3175 curr->comm, task_pid_nr(curr)); 3177 curr->comm, task_pid_nr(curr));
@@ -3614,6 +3616,7 @@ print_lock_contention_bug(struct task_struct *curr, struct lockdep_map *lock,
3614 printk("\n"); 3616 printk("\n");
3615 printk("=================================\n"); 3617 printk("=================================\n");
3616 printk("[ BUG: bad contention detected! ]\n"); 3618 printk("[ BUG: bad contention detected! ]\n");
3619 print_kernel_ident();
3617 printk("---------------------------------\n"); 3620 printk("---------------------------------\n");
3618 printk("%s/%d is trying to contend lock (", 3621 printk("%s/%d is trying to contend lock (",
3619 curr->comm, task_pid_nr(curr)); 3622 curr->comm, task_pid_nr(curr));
@@ -3988,6 +3991,7 @@ print_freed_lock_bug(struct task_struct *curr, const void *mem_from,
3988 printk("\n"); 3991 printk("\n");
3989 printk("=========================\n"); 3992 printk("=========================\n");
3990 printk("[ BUG: held lock freed! ]\n"); 3993 printk("[ BUG: held lock freed! ]\n");
3994 print_kernel_ident();
3991 printk("-------------------------\n"); 3995 printk("-------------------------\n");
3992 printk("%s/%d is freeing memory %p-%p, with a lock still held there!\n", 3996 printk("%s/%d is freeing memory %p-%p, with a lock still held there!\n",
3993 curr->comm, task_pid_nr(curr), mem_from, mem_to-1); 3997 curr->comm, task_pid_nr(curr), mem_from, mem_to-1);
@@ -4045,6 +4049,7 @@ static void print_held_locks_bug(struct task_struct *curr)
4045 printk("\n"); 4049 printk("\n");
4046 printk("=====================================\n"); 4050 printk("=====================================\n");
4047 printk("[ BUG: lock held at task exit time! ]\n"); 4051 printk("[ BUG: lock held at task exit time! ]\n");
4052 print_kernel_ident();
4048 printk("-------------------------------------\n"); 4053 printk("-------------------------------------\n");
4049 printk("%s/%d is exiting with locks still held!\n", 4054 printk("%s/%d is exiting with locks still held!\n",
4050 curr->comm, task_pid_nr(curr)); 4055 curr->comm, task_pid_nr(curr));
@@ -4142,6 +4147,7 @@ void lockdep_sys_exit(void)
4142 printk("\n"); 4147 printk("\n");
4143 printk("================================================\n"); 4148 printk("================================================\n");
4144 printk("[ BUG: lock held when returning to user space! ]\n"); 4149 printk("[ BUG: lock held when returning to user space! ]\n");
4150 print_kernel_ident();
4145 printk("------------------------------------------------\n"); 4151 printk("------------------------------------------------\n");
4146 printk("%s/%d is leaving the kernel with locks still held!\n", 4152 printk("%s/%d is leaving the kernel with locks still held!\n",
4147 curr->comm, curr->pid); 4153 curr->comm, curr->pid);
@@ -4161,6 +4167,7 @@ void lockdep_rcu_suspicious(const char *file, const int line, const char *s)
4161 printk("\n"); 4167 printk("\n");
4162 printk("===============================\n"); 4168 printk("===============================\n");
4163 printk("[ INFO: suspicious RCU usage. ]\n"); 4169 printk("[ INFO: suspicious RCU usage. ]\n");
4170 print_kernel_ident();
4164 printk("-------------------------------\n"); 4171 printk("-------------------------------\n");
4165 printk("%s:%d %s!\n", file, line, s); 4172 printk("%s:%d %s!\n", file, line, s);
4166 printk("\nother info that might help us debug this:\n\n"); 4173 printk("\nother info that might help us debug this:\n\n");
diff --git a/kernel/rtmutex-debug.c b/kernel/rtmutex-debug.c
index 8eafd1bd273..16502d3a71c 100644
--- a/kernel/rtmutex-debug.c
+++ b/kernel/rtmutex-debug.c
@@ -101,6 +101,7 @@ void debug_rt_mutex_print_deadlock(struct rt_mutex_waiter *waiter)
101 101
102 printk("\n============================================\n"); 102 printk("\n============================================\n");
103 printk( "[ BUG: circular locking deadlock detected! ]\n"); 103 printk( "[ BUG: circular locking deadlock detected! ]\n");
104 printk("%s\n", print_tainted());
104 printk( "--------------------------------------------\n"); 105 printk( "--------------------------------------------\n");
105 printk("%s/%d is deadlocking current task %s/%d\n\n", 106 printk("%s/%d is deadlocking current task %s/%d\n\n",
106 task->comm, task_pid_nr(task), 107 task->comm, task_pid_nr(task),