diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/lockdep.c | 6 | ||||
-rw-r--r-- | kernel/lockdep_internals.h | 13 | ||||
-rw-r--r-- | kernel/lockdep_proc.c | 12 | ||||
-rw-r--r-- | kernel/spinlock.c | 3 |
4 files changed, 21 insertions, 13 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 1aa91fd6b06e..77fa776a2da8 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -1759,11 +1759,10 @@ static void check_chain_key(struct task_struct *curr) | |||
1759 | hlock = curr->held_locks + i; | 1759 | hlock = curr->held_locks + i; |
1760 | if (chain_key != hlock->prev_chain_key) { | 1760 | if (chain_key != hlock->prev_chain_key) { |
1761 | debug_locks_off(); | 1761 | debug_locks_off(); |
1762 | printk("hm#1, depth: %u [%u], %016Lx != %016Lx\n", | 1762 | WARN(1, "hm#1, depth: %u [%u], %016Lx != %016Lx\n", |
1763 | curr->lockdep_depth, i, | 1763 | curr->lockdep_depth, i, |
1764 | (unsigned long long)chain_key, | 1764 | (unsigned long long)chain_key, |
1765 | (unsigned long long)hlock->prev_chain_key); | 1765 | (unsigned long long)hlock->prev_chain_key); |
1766 | WARN_ON(1); | ||
1767 | return; | 1766 | return; |
1768 | } | 1767 | } |
1769 | id = hlock->class_idx - 1; | 1768 | id = hlock->class_idx - 1; |
@@ -1778,11 +1777,10 @@ static void check_chain_key(struct task_struct *curr) | |||
1778 | } | 1777 | } |
1779 | if (chain_key != curr->curr_chain_key) { | 1778 | if (chain_key != curr->curr_chain_key) { |
1780 | debug_locks_off(); | 1779 | debug_locks_off(); |
1781 | printk("hm#2, depth: %u [%u], %016Lx != %016Lx\n", | 1780 | WARN(1, "hm#2, depth: %u [%u], %016Lx != %016Lx\n", |
1782 | curr->lockdep_depth, i, | 1781 | curr->lockdep_depth, i, |
1783 | (unsigned long long)chain_key, | 1782 | (unsigned long long)chain_key, |
1784 | (unsigned long long)curr->curr_chain_key); | 1783 | (unsigned long long)curr->curr_chain_key); |
1785 | WARN_ON(1); | ||
1786 | } | 1784 | } |
1787 | #endif | 1785 | #endif |
1788 | } | 1786 | } |
diff --git a/kernel/lockdep_internals.h b/kernel/lockdep_internals.h index 55db193d366d..56b196932c08 100644 --- a/kernel/lockdep_internals.h +++ b/kernel/lockdep_internals.h | |||
@@ -50,8 +50,21 @@ extern unsigned int nr_process_chains; | |||
50 | extern unsigned int max_lockdep_depth; | 50 | extern unsigned int max_lockdep_depth; |
51 | extern unsigned int max_recursion_depth; | 51 | extern unsigned int max_recursion_depth; |
52 | 52 | ||
53 | #ifdef CONFIG_PROVE_LOCKING | ||
53 | extern unsigned long lockdep_count_forward_deps(struct lock_class *); | 54 | extern unsigned long lockdep_count_forward_deps(struct lock_class *); |
54 | extern unsigned long lockdep_count_backward_deps(struct lock_class *); | 55 | extern unsigned long lockdep_count_backward_deps(struct lock_class *); |
56 | #else | ||
57 | static inline unsigned long | ||
58 | lockdep_count_forward_deps(struct lock_class *class) | ||
59 | { | ||
60 | return 0; | ||
61 | } | ||
62 | static inline unsigned long | ||
63 | lockdep_count_backward_deps(struct lock_class *class) | ||
64 | { | ||
65 | return 0; | ||
66 | } | ||
67 | #endif | ||
55 | 68 | ||
56 | #ifdef CONFIG_DEBUG_LOCKDEP | 69 | #ifdef CONFIG_DEBUG_LOCKDEP |
57 | /* | 70 | /* |
diff --git a/kernel/lockdep_proc.c b/kernel/lockdep_proc.c index fa19aee604c2..4b194d34d77f 100644 --- a/kernel/lockdep_proc.c +++ b/kernel/lockdep_proc.c | |||
@@ -82,7 +82,6 @@ static void print_name(struct seq_file *m, struct lock_class *class) | |||
82 | 82 | ||
83 | static int l_show(struct seq_file *m, void *v) | 83 | static int l_show(struct seq_file *m, void *v) |
84 | { | 84 | { |
85 | unsigned long nr_forward_deps, nr_backward_deps; | ||
86 | struct lock_class *class = v; | 85 | struct lock_class *class = v; |
87 | struct lock_list *entry; | 86 | struct lock_list *entry; |
88 | char c1, c2, c3, c4; | 87 | char c1, c2, c3, c4; |
@@ -96,11 +95,10 @@ static int l_show(struct seq_file *m, void *v) | |||
96 | #ifdef CONFIG_DEBUG_LOCKDEP | 95 | #ifdef CONFIG_DEBUG_LOCKDEP |
97 | seq_printf(m, " OPS:%8ld", class->ops); | 96 | seq_printf(m, " OPS:%8ld", class->ops); |
98 | #endif | 97 | #endif |
99 | nr_forward_deps = lockdep_count_forward_deps(class); | 98 | #ifdef CONFIG_PROVE_LOCKING |
100 | seq_printf(m, " FD:%5ld", nr_forward_deps); | 99 | seq_printf(m, " FD:%5ld", lockdep_count_forward_deps(class)); |
101 | 100 | seq_printf(m, " BD:%5ld", lockdep_count_backward_deps(class)); | |
102 | nr_backward_deps = lockdep_count_backward_deps(class); | 101 | #endif |
103 | seq_printf(m, " BD:%5ld", nr_backward_deps); | ||
104 | 102 | ||
105 | get_usage_chars(class, &c1, &c2, &c3, &c4); | 103 | get_usage_chars(class, &c1, &c2, &c3, &c4); |
106 | seq_printf(m, " %c%c%c%c", c1, c2, c3, c4); | 104 | seq_printf(m, " %c%c%c%c", c1, c2, c3, c4); |
@@ -325,7 +323,9 @@ static int lockdep_stats_show(struct seq_file *m, void *v) | |||
325 | if (class->usage_mask & LOCKF_ENABLED_HARDIRQS_READ) | 323 | if (class->usage_mask & LOCKF_ENABLED_HARDIRQS_READ) |
326 | nr_hardirq_read_unsafe++; | 324 | nr_hardirq_read_unsafe++; |
327 | 325 | ||
326 | #ifdef CONFIG_PROVE_LOCKING | ||
328 | sum_forward_deps += lockdep_count_forward_deps(class); | 327 | sum_forward_deps += lockdep_count_forward_deps(class); |
328 | #endif | ||
329 | } | 329 | } |
330 | #ifdef CONFIG_DEBUG_LOCKDEP | 330 | #ifdef CONFIG_DEBUG_LOCKDEP |
331 | DEBUG_LOCKS_WARN_ON(debug_atomic_read(&nr_unused_locks) != nr_unused); | 331 | DEBUG_LOCKS_WARN_ON(debug_atomic_read(&nr_unused_locks) != nr_unused); |
diff --git a/kernel/spinlock.c b/kernel/spinlock.c index 44baeea94ab9..29ab20749dd3 100644 --- a/kernel/spinlock.c +++ b/kernel/spinlock.c | |||
@@ -290,7 +290,6 @@ void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) | |||
290 | spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); | 290 | spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); |
291 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); | 291 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); |
292 | } | 292 | } |
293 | |||
294 | EXPORT_SYMBOL(_spin_lock_nested); | 293 | EXPORT_SYMBOL(_spin_lock_nested); |
295 | 294 | ||
296 | unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass) | 295 | unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass) |
@@ -312,7 +311,6 @@ unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclas | |||
312 | #endif | 311 | #endif |
313 | return flags; | 312 | return flags; |
314 | } | 313 | } |
315 | |||
316 | EXPORT_SYMBOL(_spin_lock_irqsave_nested); | 314 | EXPORT_SYMBOL(_spin_lock_irqsave_nested); |
317 | 315 | ||
318 | void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, | 316 | void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, |
@@ -322,7 +320,6 @@ void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, | |||
322 | spin_acquire_nest(&lock->dep_map, 0, 0, nest_lock, _RET_IP_); | 320 | spin_acquire_nest(&lock->dep_map, 0, 0, nest_lock, _RET_IP_); |
323 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); | 321 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); |
324 | } | 322 | } |
325 | |||
326 | EXPORT_SYMBOL(_spin_lock_nest_lock); | 323 | EXPORT_SYMBOL(_spin_lock_nest_lock); |
327 | 324 | ||
328 | #endif | 325 | #endif |