aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/lockdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r--kernel/lockdep.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 069af0276bf7..78325f8f1139 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -43,6 +43,7 @@
43#include <linux/ftrace.h> 43#include <linux/ftrace.h>
44#include <linux/stringify.h> 44#include <linux/stringify.h>
45#include <linux/bitops.h> 45#include <linux/bitops.h>
46#include <linux/gfp.h>
46 47
47#include <asm/sections.h> 48#include <asm/sections.h>
48 49
@@ -569,9 +570,6 @@ static int static_obj(void *obj)
569 unsigned long start = (unsigned long) &_stext, 570 unsigned long start = (unsigned long) &_stext,
570 end = (unsigned long) &_end, 571 end = (unsigned long) &_end,
571 addr = (unsigned long) obj; 572 addr = (unsigned long) obj;
572#ifdef CONFIG_SMP
573 int i;
574#endif
575 573
576 /* 574 /*
577 * static variable? 575 * static variable?
@@ -582,24 +580,16 @@ static int static_obj(void *obj)
582 if (arch_is_kernel_data(addr)) 580 if (arch_is_kernel_data(addr))
583 return 1; 581 return 1;
584 582
585#ifdef CONFIG_SMP
586 /* 583 /*
587 * percpu var? 584 * in-kernel percpu var?
588 */ 585 */
589 for_each_possible_cpu(i) { 586 if (is_kernel_percpu_address(addr))
590 start = (unsigned long) &__per_cpu_start + per_cpu_offset(i); 587 return 1;
591 end = (unsigned long) &__per_cpu_start + PERCPU_ENOUGH_ROOM
592 + per_cpu_offset(i);
593
594 if ((addr >= start) && (addr < end))
595 return 1;
596 }
597#endif
598 588
599 /* 589 /*
600 * module var? 590 * module static or percpu var?
601 */ 591 */
602 return is_module_address(addr); 592 return is_module_address(addr) || is_module_percpu_address(addr);
603} 593}
604 594
605/* 595/*
@@ -3198,8 +3188,6 @@ void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
3198{ 3188{
3199 unsigned long flags; 3189 unsigned long flags;
3200 3190
3201 trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip);
3202
3203 if (unlikely(current->lockdep_recursion)) 3191 if (unlikely(current->lockdep_recursion))
3204 return; 3192 return;
3205 3193
@@ -3207,6 +3195,7 @@ void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
3207 check_flags(flags); 3195 check_flags(flags);
3208 3196
3209 current->lockdep_recursion = 1; 3197 current->lockdep_recursion = 1;
3198 trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip);
3210 __lock_acquire(lock, subclass, trylock, read, check, 3199 __lock_acquire(lock, subclass, trylock, read, check,
3211 irqs_disabled_flags(flags), nest_lock, ip, 0); 3200 irqs_disabled_flags(flags), nest_lock, ip, 0);
3212 current->lockdep_recursion = 0; 3201 current->lockdep_recursion = 0;
@@ -3219,14 +3208,13 @@ void lock_release(struct lockdep_map *lock, int nested,
3219{ 3208{
3220 unsigned long flags; 3209 unsigned long flags;
3221 3210
3222 trace_lock_release(lock, nested, ip);
3223
3224 if (unlikely(current->lockdep_recursion)) 3211 if (unlikely(current->lockdep_recursion))
3225 return; 3212 return;
3226 3213
3227 raw_local_irq_save(flags); 3214 raw_local_irq_save(flags);
3228 check_flags(flags); 3215 check_flags(flags);
3229 current->lockdep_recursion = 1; 3216 current->lockdep_recursion = 1;
3217 trace_lock_release(lock, nested, ip);
3230 __lock_release(lock, nested, ip); 3218 __lock_release(lock, nested, ip);
3231 current->lockdep_recursion = 0; 3219 current->lockdep_recursion = 0;
3232 raw_local_irq_restore(flags); 3220 raw_local_irq_restore(flags);
@@ -3400,8 +3388,6 @@ void lock_contended(struct lockdep_map *lock, unsigned long ip)
3400{ 3388{
3401 unsigned long flags; 3389 unsigned long flags;
3402 3390
3403 trace_lock_contended(lock, ip);
3404
3405 if (unlikely(!lock_stat)) 3391 if (unlikely(!lock_stat))
3406 return; 3392 return;
3407 3393
@@ -3411,6 +3397,7 @@ void lock_contended(struct lockdep_map *lock, unsigned long ip)
3411 raw_local_irq_save(flags); 3397 raw_local_irq_save(flags);
3412 check_flags(flags); 3398 check_flags(flags);
3413 current->lockdep_recursion = 1; 3399 current->lockdep_recursion = 1;
3400 trace_lock_contended(lock, ip);
3414 __lock_contended(lock, ip); 3401 __lock_contended(lock, ip);
3415 current->lockdep_recursion = 0; 3402 current->lockdep_recursion = 0;
3416 raw_local_irq_restore(flags); 3403 raw_local_irq_restore(flags);
@@ -3809,6 +3796,7 @@ void lockdep_rcu_dereference(const char *file, const int line)
3809 printk("%s:%d invoked rcu_dereference_check() without protection!\n", 3796 printk("%s:%d invoked rcu_dereference_check() without protection!\n",
3810 file, line); 3797 file, line);
3811 printk("\nother info that might help us debug this:\n\n"); 3798 printk("\nother info that might help us debug this:\n\n");
3799 printk("\nrcu_scheduler_active = %d, debug_locks = %d\n", rcu_scheduler_active, debug_locks);
3812 lockdep_print_held_locks(curr); 3800 lockdep_print_held_locks(curr);
3813 printk("\nstack backtrace:\n"); 3801 printk("\nstack backtrace:\n");
3814 dump_stack(); 3802 dump_stack();