diff options
Diffstat (limited to 'kernel/lockdep.c')
| -rw-r--r-- | kernel/lockdep.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index c62ec14609b9..c927a549db2c 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
| @@ -3211,8 +3211,6 @@ void lock_acquire(struct lockdep_map *lock, unsigned int subclass, | |||
| 3211 | { | 3211 | { |
| 3212 | unsigned long flags; | 3212 | unsigned long flags; |
| 3213 | 3213 | ||
| 3214 | trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); | ||
| 3215 | |||
| 3216 | if (unlikely(current->lockdep_recursion)) | 3214 | if (unlikely(current->lockdep_recursion)) |
| 3217 | return; | 3215 | return; |
| 3218 | 3216 | ||
| @@ -3220,6 +3218,7 @@ void lock_acquire(struct lockdep_map *lock, unsigned int subclass, | |||
| 3220 | check_flags(flags); | 3218 | check_flags(flags); |
| 3221 | 3219 | ||
| 3222 | current->lockdep_recursion = 1; | 3220 | current->lockdep_recursion = 1; |
| 3221 | trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); | ||
| 3223 | __lock_acquire(lock, subclass, trylock, read, check, | 3222 | __lock_acquire(lock, subclass, trylock, read, check, |
| 3224 | irqs_disabled_flags(flags), nest_lock, ip, 0); | 3223 | irqs_disabled_flags(flags), nest_lock, ip, 0); |
| 3225 | current->lockdep_recursion = 0; | 3224 | current->lockdep_recursion = 0; |
| @@ -3232,14 +3231,13 @@ void lock_release(struct lockdep_map *lock, int nested, | |||
| 3232 | { | 3231 | { |
| 3233 | unsigned long flags; | 3232 | unsigned long flags; |
| 3234 | 3233 | ||
| 3235 | trace_lock_release(lock, nested, ip); | ||
| 3236 | |||
| 3237 | if (unlikely(current->lockdep_recursion)) | 3234 | if (unlikely(current->lockdep_recursion)) |
| 3238 | return; | 3235 | return; |
| 3239 | 3236 | ||
| 3240 | raw_local_irq_save(flags); | 3237 | raw_local_irq_save(flags); |
| 3241 | check_flags(flags); | 3238 | check_flags(flags); |
| 3242 | current->lockdep_recursion = 1; | 3239 | current->lockdep_recursion = 1; |
| 3240 | trace_lock_release(lock, nested, ip); | ||
| 3243 | __lock_release(lock, nested, ip); | 3241 | __lock_release(lock, nested, ip); |
| 3244 | current->lockdep_recursion = 0; | 3242 | current->lockdep_recursion = 0; |
| 3245 | raw_local_irq_restore(flags); | 3243 | raw_local_irq_restore(flags); |
| @@ -3413,8 +3411,6 @@ void lock_contended(struct lockdep_map *lock, unsigned long ip) | |||
| 3413 | { | 3411 | { |
| 3414 | unsigned long flags; | 3412 | unsigned long flags; |
| 3415 | 3413 | ||
| 3416 | trace_lock_contended(lock, ip); | ||
| 3417 | |||
| 3418 | if (unlikely(!lock_stat)) | 3414 | if (unlikely(!lock_stat)) |
| 3419 | return; | 3415 | return; |
| 3420 | 3416 | ||
| @@ -3424,6 +3420,7 @@ void lock_contended(struct lockdep_map *lock, unsigned long ip) | |||
| 3424 | raw_local_irq_save(flags); | 3420 | raw_local_irq_save(flags); |
| 3425 | check_flags(flags); | 3421 | check_flags(flags); |
| 3426 | current->lockdep_recursion = 1; | 3422 | current->lockdep_recursion = 1; |
| 3423 | trace_lock_contended(lock, ip); | ||
| 3427 | __lock_contended(lock, ip); | 3424 | __lock_contended(lock, ip); |
| 3428 | current->lockdep_recursion = 0; | 3425 | current->lockdep_recursion = 0; |
| 3429 | raw_local_irq_restore(flags); | 3426 | raw_local_irq_restore(flags); |
| @@ -3809,3 +3806,22 @@ void lockdep_sys_exit(void) | |||
| 3809 | lockdep_print_held_locks(curr); | 3806 | lockdep_print_held_locks(curr); |
| 3810 | } | 3807 | } |
| 3811 | } | 3808 | } |
| 3809 | |||
| 3810 | void lockdep_rcu_dereference(const char *file, const int line) | ||
| 3811 | { | ||
| 3812 | struct task_struct *curr = current; | ||
| 3813 | |||
| 3814 | if (!debug_locks_off()) | ||
| 3815 | return; | ||
| 3816 | printk("\n===================================================\n"); | ||
| 3817 | printk( "[ INFO: suspicious rcu_dereference_check() usage. ]\n"); | ||
| 3818 | printk( "---------------------------------------------------\n"); | ||
| 3819 | printk("%s:%d invoked rcu_dereference_check() without protection!\n", | ||
| 3820 | file, line); | ||
| 3821 | printk("\nother info that might help us debug this:\n\n"); | ||
| 3822 | printk("\nrcu_scheduler_active = %d, debug_locks = %d\n", rcu_scheduler_active, debug_locks); | ||
| 3823 | lockdep_print_held_locks(curr); | ||
| 3824 | printk("\nstack backtrace:\n"); | ||
| 3825 | dump_stack(); | ||
| 3826 | } | ||
| 3827 | EXPORT_SYMBOL_GPL(lockdep_rcu_dereference); | ||
