diff options
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r-- | kernel/lockdep.c | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 681bc2e1e187..2594e1ce41cb 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 | ||
@@ -582,9 +583,6 @@ static int static_obj(void *obj) | |||
582 | unsigned long start = (unsigned long) &_stext, | 583 | unsigned long start = (unsigned long) &_stext, |
583 | end = (unsigned long) &_end, | 584 | end = (unsigned long) &_end, |
584 | addr = (unsigned long) obj; | 585 | addr = (unsigned long) obj; |
585 | #ifdef CONFIG_SMP | ||
586 | int i; | ||
587 | #endif | ||
588 | 586 | ||
589 | /* | 587 | /* |
590 | * static variable? | 588 | * static variable? |
@@ -595,24 +593,16 @@ static int static_obj(void *obj) | |||
595 | if (arch_is_kernel_data(addr)) | 593 | if (arch_is_kernel_data(addr)) |
596 | return 1; | 594 | return 1; |
597 | 595 | ||
598 | #ifdef CONFIG_SMP | ||
599 | /* | 596 | /* |
600 | * percpu var? | 597 | * in-kernel percpu var? |
601 | */ | 598 | */ |
602 | for_each_possible_cpu(i) { | 599 | if (is_kernel_percpu_address(addr)) |
603 | start = (unsigned long) &__per_cpu_start + per_cpu_offset(i); | 600 | return 1; |
604 | end = (unsigned long) &__per_cpu_start + PERCPU_ENOUGH_ROOM | ||
605 | + per_cpu_offset(i); | ||
606 | |||
607 | if ((addr >= start) && (addr < end)) | ||
608 | return 1; | ||
609 | } | ||
610 | #endif | ||
611 | 601 | ||
612 | /* | 602 | /* |
613 | * module var? | 603 | * module static or percpu var? |
614 | */ | 604 | */ |
615 | return is_module_address(addr); | 605 | return is_module_address(addr) || is_module_percpu_address(addr); |
616 | } | 606 | } |
617 | 607 | ||
618 | /* | 608 | /* |
@@ -3211,8 +3201,6 @@ void lock_acquire(struct lockdep_map *lock, unsigned int subclass, | |||
3211 | { | 3201 | { |
3212 | unsigned long flags; | 3202 | unsigned long flags; |
3213 | 3203 | ||
3214 | trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); | ||
3215 | |||
3216 | if (unlikely(current->lockdep_recursion)) | 3204 | if (unlikely(current->lockdep_recursion)) |
3217 | return; | 3205 | return; |
3218 | 3206 | ||
@@ -3220,6 +3208,7 @@ void lock_acquire(struct lockdep_map *lock, unsigned int subclass, | |||
3220 | check_flags(flags); | 3208 | check_flags(flags); |
3221 | 3209 | ||
3222 | current->lockdep_recursion = 1; | 3210 | current->lockdep_recursion = 1; |
3211 | trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); | ||
3223 | __lock_acquire(lock, subclass, trylock, read, check, | 3212 | __lock_acquire(lock, subclass, trylock, read, check, |
3224 | irqs_disabled_flags(flags), nest_lock, ip, 0); | 3213 | irqs_disabled_flags(flags), nest_lock, ip, 0); |
3225 | current->lockdep_recursion = 0; | 3214 | current->lockdep_recursion = 0; |
@@ -3232,14 +3221,13 @@ void lock_release(struct lockdep_map *lock, int nested, | |||
3232 | { | 3221 | { |
3233 | unsigned long flags; | 3222 | unsigned long flags; |
3234 | 3223 | ||
3235 | trace_lock_release(lock, nested, ip); | ||
3236 | |||
3237 | if (unlikely(current->lockdep_recursion)) | 3224 | if (unlikely(current->lockdep_recursion)) |
3238 | return; | 3225 | return; |
3239 | 3226 | ||
3240 | raw_local_irq_save(flags); | 3227 | raw_local_irq_save(flags); |
3241 | check_flags(flags); | 3228 | check_flags(flags); |
3242 | current->lockdep_recursion = 1; | 3229 | current->lockdep_recursion = 1; |
3230 | trace_lock_release(lock, nested, ip); | ||
3243 | __lock_release(lock, nested, ip); | 3231 | __lock_release(lock, nested, ip); |
3244 | current->lockdep_recursion = 0; | 3232 | current->lockdep_recursion = 0; |
3245 | raw_local_irq_restore(flags); | 3233 | raw_local_irq_restore(flags); |
@@ -3413,8 +3401,6 @@ void lock_contended(struct lockdep_map *lock, unsigned long ip) | |||
3413 | { | 3401 | { |
3414 | unsigned long flags; | 3402 | unsigned long flags; |
3415 | 3403 | ||
3416 | trace_lock_contended(lock, ip); | ||
3417 | |||
3418 | if (unlikely(!lock_stat)) | 3404 | if (unlikely(!lock_stat)) |
3419 | return; | 3405 | return; |
3420 | 3406 | ||
@@ -3424,6 +3410,7 @@ void lock_contended(struct lockdep_map *lock, unsigned long ip) | |||
3424 | raw_local_irq_save(flags); | 3410 | raw_local_irq_save(flags); |
3425 | check_flags(flags); | 3411 | check_flags(flags); |
3426 | current->lockdep_recursion = 1; | 3412 | current->lockdep_recursion = 1; |
3413 | trace_lock_contended(lock, ip); | ||
3427 | __lock_contended(lock, ip); | 3414 | __lock_contended(lock, ip); |
3428 | current->lockdep_recursion = 0; | 3415 | current->lockdep_recursion = 0; |
3429 | raw_local_irq_restore(flags); | 3416 | raw_local_irq_restore(flags); |