Commit 406703f8 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'core-fixes-for-linus' of...

Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  lockdep: fix build if CONFIG_PROVE_LOCKING not defined
  lockdep: use WARN() in kernel/lockdep.c
  lockdep: spin_lock_nest_lock(), checkpatch fixes
  lockdep: build fix
parents c100548d df60a844
...@@ -1759,11 +1759,10 @@ static void check_chain_key(struct task_struct *curr) ...@@ -1759,11 +1759,10 @@ static void check_chain_key(struct task_struct *curr)
hlock = curr->held_locks + i; hlock = curr->held_locks + i;
if (chain_key != hlock->prev_chain_key) { if (chain_key != hlock->prev_chain_key) {
debug_locks_off(); debug_locks_off();
printk("hm#1, depth: %u [%u], %016Lx != %016Lx\n", WARN(1, "hm#1, depth: %u [%u], %016Lx != %016Lx\n",
curr->lockdep_depth, i, curr->lockdep_depth, i,
(unsigned long long)chain_key, (unsigned long long)chain_key,
(unsigned long long)hlock->prev_chain_key); (unsigned long long)hlock->prev_chain_key);
WARN_ON(1);
return; return;
} }
id = hlock->class_idx - 1; id = hlock->class_idx - 1;
...@@ -1778,11 +1777,10 @@ static void check_chain_key(struct task_struct *curr) ...@@ -1778,11 +1777,10 @@ static void check_chain_key(struct task_struct *curr)
} }
if (chain_key != curr->curr_chain_key) { if (chain_key != curr->curr_chain_key) {
debug_locks_off(); debug_locks_off();
printk("hm#2, depth: %u [%u], %016Lx != %016Lx\n", WARN(1, "hm#2, depth: %u [%u], %016Lx != %016Lx\n",
curr->lockdep_depth, i, curr->lockdep_depth, i,
(unsigned long long)chain_key, (unsigned long long)chain_key,
(unsigned long long)curr->curr_chain_key); (unsigned long long)curr->curr_chain_key);
WARN_ON(1);
} }
#endif #endif
} }
......
...@@ -50,8 +50,21 @@ extern unsigned int nr_process_chains; ...@@ -50,8 +50,21 @@ extern unsigned int nr_process_chains;
extern unsigned int max_lockdep_depth; extern unsigned int max_lockdep_depth;
extern unsigned int max_recursion_depth; extern unsigned int max_recursion_depth;
#ifdef CONFIG_PROVE_LOCKING
extern unsigned long lockdep_count_forward_deps(struct lock_class *); extern unsigned long lockdep_count_forward_deps(struct lock_class *);
extern unsigned long lockdep_count_backward_deps(struct lock_class *); extern unsigned long lockdep_count_backward_deps(struct lock_class *);
#else
static inline unsigned long
lockdep_count_forward_deps(struct lock_class *class)
{
return 0;
}
static inline unsigned long
lockdep_count_backward_deps(struct lock_class *class)
{
return 0;
}
#endif
#ifdef CONFIG_DEBUG_LOCKDEP #ifdef CONFIG_DEBUG_LOCKDEP
/* /*
......
...@@ -82,7 +82,6 @@ static void print_name(struct seq_file *m, struct lock_class *class) ...@@ -82,7 +82,6 @@ static void print_name(struct seq_file *m, struct lock_class *class)
static int l_show(struct seq_file *m, void *v) static int l_show(struct seq_file *m, void *v)
{ {
unsigned long nr_forward_deps, nr_backward_deps;
struct lock_class *class = v; struct lock_class *class = v;
struct lock_list *entry; struct lock_list *entry;
char c1, c2, c3, c4; char c1, c2, c3, c4;
...@@ -96,11 +95,10 @@ static int l_show(struct seq_file *m, void *v) ...@@ -96,11 +95,10 @@ static int l_show(struct seq_file *m, void *v)
#ifdef CONFIG_DEBUG_LOCKDEP #ifdef CONFIG_DEBUG_LOCKDEP
seq_printf(m, " OPS:%8ld", class->ops); seq_printf(m, " OPS:%8ld", class->ops);
#endif #endif
nr_forward_deps = lockdep_count_forward_deps(class); #ifdef CONFIG_PROVE_LOCKING
seq_printf(m, " FD:%5ld", nr_forward_deps); seq_printf(m, " FD:%5ld", lockdep_count_forward_deps(class));
seq_printf(m, " BD:%5ld", lockdep_count_backward_deps(class));
nr_backward_deps = lockdep_count_backward_deps(class); #endif
seq_printf(m, " BD:%5ld", nr_backward_deps);
get_usage_chars(class, &c1, &c2, &c3, &c4); get_usage_chars(class, &c1, &c2, &c3, &c4);
seq_printf(m, " %c%c%c%c", c1, c2, c3, c4); 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,7 +323,9 @@ static int lockdep_stats_show(struct seq_file *m, void *v)
if (class->usage_mask & LOCKF_ENABLED_HARDIRQS_READ) if (class->usage_mask & LOCKF_ENABLED_HARDIRQS_READ)
nr_hardirq_read_unsafe++; nr_hardirq_read_unsafe++;
#ifdef CONFIG_PROVE_LOCKING
sum_forward_deps += lockdep_count_forward_deps(class); sum_forward_deps += lockdep_count_forward_deps(class);
#endif
} }
#ifdef CONFIG_DEBUG_LOCKDEP #ifdef CONFIG_DEBUG_LOCKDEP
DEBUG_LOCKS_WARN_ON(debug_atomic_read(&nr_unused_locks) != nr_unused); DEBUG_LOCKS_WARN_ON(debug_atomic_read(&nr_unused_locks) != nr_unused);
......
...@@ -290,7 +290,6 @@ void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) ...@@ -290,7 +290,6 @@ void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass)
spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_);
LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock);
} }
EXPORT_SYMBOL(_spin_lock_nested); EXPORT_SYMBOL(_spin_lock_nested);
unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass) 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,7 +311,6 @@ unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclas
#endif #endif
return flags; return flags;
} }
EXPORT_SYMBOL(_spin_lock_irqsave_nested); EXPORT_SYMBOL(_spin_lock_irqsave_nested);
void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, void __lockfunc _spin_lock_nest_lock(spinlock_t *lock,
...@@ -322,7 +320,6 @@ void __lockfunc _spin_lock_nest_lock(spinlock_t *lock, ...@@ -322,7 +320,6 @@ void __lockfunc _spin_lock_nest_lock(spinlock_t *lock,
spin_acquire_nest(&lock->dep_map, 0, 0, nest_lock, _RET_IP_); spin_acquire_nest(&lock->dep_map, 0, 0, nest_lock, _RET_IP_);
LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock);
} }
EXPORT_SYMBOL(_spin_lock_nest_lock); EXPORT_SYMBOL(_spin_lock_nest_lock);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment