diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-08-04 03:09:27 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-08-04 03:09:27 -0400 |
commit | d7619fe39d9769b4d4545cc511c891deea18ae08 (patch) | |
tree | 0a902533414001075b2245825e145cc2e35ce985 /kernel/lockdep.c | |
parent | 9ea71503a8ed9184d2d0b8ccc4d269d05f7940ae (diff) | |
parent | ed8f37370d83e695c0a4fa5d5fc7a83ecb947526 (diff) |
Merge branch 'linus' into core/urgent
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r-- | kernel/lockdep.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 298c9276dfdb..3956f5149e25 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -2468,6 +2468,9 @@ mark_held_locks(struct task_struct *curr, enum mark_type mark) | |||
2468 | 2468 | ||
2469 | BUG_ON(usage_bit >= LOCK_USAGE_STATES); | 2469 | BUG_ON(usage_bit >= LOCK_USAGE_STATES); |
2470 | 2470 | ||
2471 | if (hlock_class(hlock)->key == &__lockdep_no_validate__) | ||
2472 | continue; | ||
2473 | |||
2471 | if (!mark_lock(curr, hlock, usage_bit)) | 2474 | if (!mark_lock(curr, hlock, usage_bit)) |
2472 | return 0; | 2475 | return 0; |
2473 | } | 2476 | } |
@@ -2478,15 +2481,10 @@ mark_held_locks(struct task_struct *curr, enum mark_type mark) | |||
2478 | /* | 2481 | /* |
2479 | * Hardirqs will be enabled: | 2482 | * Hardirqs will be enabled: |
2480 | */ | 2483 | */ |
2481 | void trace_hardirqs_on_caller(unsigned long ip) | 2484 | static void __trace_hardirqs_on_caller(unsigned long ip) |
2482 | { | 2485 | { |
2483 | struct task_struct *curr = current; | 2486 | struct task_struct *curr = current; |
2484 | 2487 | ||
2485 | time_hardirqs_on(CALLER_ADDR0, ip); | ||
2486 | |||
2487 | if (unlikely(!debug_locks || current->lockdep_recursion)) | ||
2488 | return; | ||
2489 | |||
2490 | if (DEBUG_LOCKS_WARN_ON(unlikely(early_boot_irqs_disabled))) | 2488 | if (DEBUG_LOCKS_WARN_ON(unlikely(early_boot_irqs_disabled))) |
2491 | return; | 2489 | return; |
2492 | 2490 | ||
@@ -2502,8 +2500,6 @@ void trace_hardirqs_on_caller(unsigned long ip) | |||
2502 | /* we'll do an OFF -> ON transition: */ | 2500 | /* we'll do an OFF -> ON transition: */ |
2503 | curr->hardirqs_enabled = 1; | 2501 | curr->hardirqs_enabled = 1; |
2504 | 2502 | ||
2505 | if (DEBUG_LOCKS_WARN_ON(!irqs_disabled())) | ||
2506 | return; | ||
2507 | if (DEBUG_LOCKS_WARN_ON(current->hardirq_context)) | 2503 | if (DEBUG_LOCKS_WARN_ON(current->hardirq_context)) |
2508 | return; | 2504 | return; |
2509 | /* | 2505 | /* |
@@ -2525,6 +2521,21 @@ void trace_hardirqs_on_caller(unsigned long ip) | |||
2525 | curr->hardirq_enable_event = ++curr->irq_events; | 2521 | curr->hardirq_enable_event = ++curr->irq_events; |
2526 | debug_atomic_inc(hardirqs_on_events); | 2522 | debug_atomic_inc(hardirqs_on_events); |
2527 | } | 2523 | } |
2524 | |||
2525 | void trace_hardirqs_on_caller(unsigned long ip) | ||
2526 | { | ||
2527 | time_hardirqs_on(CALLER_ADDR0, ip); | ||
2528 | |||
2529 | if (unlikely(!debug_locks || current->lockdep_recursion)) | ||
2530 | return; | ||
2531 | |||
2532 | if (DEBUG_LOCKS_WARN_ON(!irqs_disabled())) | ||
2533 | return; | ||
2534 | |||
2535 | current->lockdep_recursion = 1; | ||
2536 | __trace_hardirqs_on_caller(ip); | ||
2537 | current->lockdep_recursion = 0; | ||
2538 | } | ||
2528 | EXPORT_SYMBOL(trace_hardirqs_on_caller); | 2539 | EXPORT_SYMBOL(trace_hardirqs_on_caller); |
2529 | 2540 | ||
2530 | void trace_hardirqs_on(void) | 2541 | void trace_hardirqs_on(void) |
@@ -2574,7 +2585,7 @@ void trace_softirqs_on(unsigned long ip) | |||
2574 | { | 2585 | { |
2575 | struct task_struct *curr = current; | 2586 | struct task_struct *curr = current; |
2576 | 2587 | ||
2577 | if (unlikely(!debug_locks)) | 2588 | if (unlikely(!debug_locks || current->lockdep_recursion)) |
2578 | return; | 2589 | return; |
2579 | 2590 | ||
2580 | if (DEBUG_LOCKS_WARN_ON(!irqs_disabled())) | 2591 | if (DEBUG_LOCKS_WARN_ON(!irqs_disabled())) |
@@ -2585,6 +2596,7 @@ void trace_softirqs_on(unsigned long ip) | |||
2585 | return; | 2596 | return; |
2586 | } | 2597 | } |
2587 | 2598 | ||
2599 | current->lockdep_recursion = 1; | ||
2588 | /* | 2600 | /* |
2589 | * We'll do an OFF -> ON transition: | 2601 | * We'll do an OFF -> ON transition: |
2590 | */ | 2602 | */ |
@@ -2599,6 +2611,7 @@ void trace_softirqs_on(unsigned long ip) | |||
2599 | */ | 2611 | */ |
2600 | if (curr->hardirqs_enabled) | 2612 | if (curr->hardirqs_enabled) |
2601 | mark_held_locks(curr, SOFTIRQ); | 2613 | mark_held_locks(curr, SOFTIRQ); |
2614 | current->lockdep_recursion = 0; | ||
2602 | } | 2615 | } |
2603 | 2616 | ||
2604 | /* | 2617 | /* |
@@ -2608,7 +2621,7 @@ void trace_softirqs_off(unsigned long ip) | |||
2608 | { | 2621 | { |
2609 | struct task_struct *curr = current; | 2622 | struct task_struct *curr = current; |
2610 | 2623 | ||
2611 | if (unlikely(!debug_locks)) | 2624 | if (unlikely(!debug_locks || current->lockdep_recursion)) |
2612 | return; | 2625 | return; |
2613 | 2626 | ||
2614 | if (DEBUG_LOCKS_WARN_ON(!irqs_disabled())) | 2627 | if (DEBUG_LOCKS_WARN_ON(!irqs_disabled())) |