diff options
| -rw-r--r-- | include/linux/irqflags.h | 8 | ||||
| -rw-r--r-- | kernel/lockdep.c | 16 | ||||
| -rw-r--r-- | kernel/softirq.c | 4 | ||||
| -rw-r--r-- | lib/locking-selftest.c | 4 |
4 files changed, 13 insertions, 19 deletions
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h index 74bde13224c9..b02a3f1d46a0 100644 --- a/include/linux/irqflags.h +++ b/include/linux/irqflags.h | |||
| @@ -24,8 +24,8 @@ | |||
| 24 | # define trace_softirqs_enabled(p) ((p)->softirqs_enabled) | 24 | # define trace_softirqs_enabled(p) ((p)->softirqs_enabled) |
| 25 | # define trace_hardirq_enter() do { current->hardirq_context++; } while (0) | 25 | # define trace_hardirq_enter() do { current->hardirq_context++; } while (0) |
| 26 | # define trace_hardirq_exit() do { current->hardirq_context--; } while (0) | 26 | # define trace_hardirq_exit() do { current->hardirq_context--; } while (0) |
| 27 | # define trace_softirq_enter() do { current->softirq_context++; } while (0) | 27 | # define lockdep_softirq_enter() do { current->softirq_context++; } while (0) |
| 28 | # define trace_softirq_exit() do { current->softirq_context--; } while (0) | 28 | # define lockdep_softirq_exit() do { current->softirq_context--; } while (0) |
| 29 | # define INIT_TRACE_IRQFLAGS .softirqs_enabled = 1, | 29 | # define INIT_TRACE_IRQFLAGS .softirqs_enabled = 1, |
| 30 | #else | 30 | #else |
| 31 | # define trace_hardirqs_on() do { } while (0) | 31 | # define trace_hardirqs_on() do { } while (0) |
| @@ -38,8 +38,8 @@ | |||
| 38 | # define trace_softirqs_enabled(p) 0 | 38 | # define trace_softirqs_enabled(p) 0 |
| 39 | # define trace_hardirq_enter() do { } while (0) | 39 | # define trace_hardirq_enter() do { } while (0) |
| 40 | # define trace_hardirq_exit() do { } while (0) | 40 | # define trace_hardirq_exit() do { } while (0) |
| 41 | # define trace_softirq_enter() do { } while (0) | 41 | # define lockdep_softirq_enter() do { } while (0) |
| 42 | # define trace_softirq_exit() do { } while (0) | 42 | # define lockdep_softirq_exit() do { } while (0) |
| 43 | # define INIT_TRACE_IRQFLAGS | 43 | # define INIT_TRACE_IRQFLAGS |
| 44 | #endif | 44 | #endif |
| 45 | 45 | ||
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 3673a3f44d9d..981cd4854281 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
| @@ -433,13 +433,6 @@ atomic_t nr_find_usage_forwards_checks; | |||
| 433 | atomic_t nr_find_usage_forwards_recursions; | 433 | atomic_t nr_find_usage_forwards_recursions; |
| 434 | atomic_t nr_find_usage_backwards_checks; | 434 | atomic_t nr_find_usage_backwards_checks; |
| 435 | atomic_t nr_find_usage_backwards_recursions; | 435 | atomic_t nr_find_usage_backwards_recursions; |
| 436 | # define debug_atomic_inc(ptr) atomic_inc(ptr) | ||
| 437 | # define debug_atomic_dec(ptr) atomic_dec(ptr) | ||
| 438 | # define debug_atomic_read(ptr) atomic_read(ptr) | ||
| 439 | #else | ||
| 440 | # define debug_atomic_inc(ptr) do { } while (0) | ||
| 441 | # define debug_atomic_dec(ptr) do { } while (0) | ||
| 442 | # define debug_atomic_read(ptr) 0 | ||
| 443 | #endif | 436 | #endif |
| 444 | 437 | ||
| 445 | /* | 438 | /* |
| @@ -1900,9 +1893,9 @@ print_irq_inversion_bug(struct task_struct *curr, struct lock_class *other, | |||
| 1900 | curr->comm, task_pid_nr(curr)); | 1893 | curr->comm, task_pid_nr(curr)); |
| 1901 | print_lock(this); | 1894 | print_lock(this); |
| 1902 | if (forwards) | 1895 | if (forwards) |
| 1903 | printk("but this lock took another, %s-irq-unsafe lock in the past:\n", irqclass); | 1896 | printk("but this lock took another, %s-unsafe lock in the past:\n", irqclass); |
| 1904 | else | 1897 | else |
| 1905 | printk("but this lock was taken by another, %s-irq-safe lock in the past:\n", irqclass); | 1898 | printk("but this lock was taken by another, %s-safe lock in the past:\n", irqclass); |
| 1906 | print_lock_name(other); | 1899 | print_lock_name(other); |
| 1907 | printk("\n\nand interrupts could create inverse lock ordering between them.\n\n"); | 1900 | printk("\n\nand interrupts could create inverse lock ordering between them.\n\n"); |
| 1908 | 1901 | ||
| @@ -2015,7 +2008,8 @@ typedef int (*check_usage_f)(struct task_struct *, struct held_lock *, | |||
| 2015 | enum lock_usage_bit bit, const char *name); | 2008 | enum lock_usage_bit bit, const char *name); |
| 2016 | 2009 | ||
| 2017 | static int | 2010 | static int |
| 2018 | mark_lock_irq(struct task_struct *curr, struct held_lock *this, int new_bit) | 2011 | mark_lock_irq(struct task_struct *curr, struct held_lock *this, |
| 2012 | enum lock_usage_bit new_bit) | ||
| 2019 | { | 2013 | { |
| 2020 | int excl_bit = exclusive_bit(new_bit); | 2014 | int excl_bit = exclusive_bit(new_bit); |
| 2021 | int read = new_bit & 1; | 2015 | int read = new_bit & 1; |
| @@ -2043,7 +2037,7 @@ mark_lock_irq(struct task_struct *curr, struct held_lock *this, int new_bit) | |||
| 2043 | * states. | 2037 | * states. |
| 2044 | */ | 2038 | */ |
| 2045 | if ((!read || !dir || STRICT_READ_CHECKS) && | 2039 | if ((!read || !dir || STRICT_READ_CHECKS) && |
| 2046 | !usage(curr, this, excl_bit, state_name(new_bit))) | 2040 | !usage(curr, this, excl_bit, state_name(new_bit & ~1))) |
| 2047 | return 0; | 2041 | return 0; |
| 2048 | 2042 | ||
| 2049 | /* | 2043 | /* |
diff --git a/kernel/softirq.c b/kernel/softirq.c index 57d3f67f6f38..487751604300 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
| @@ -180,7 +180,7 @@ asmlinkage void __do_softirq(void) | |||
| 180 | account_system_vtime(current); | 180 | account_system_vtime(current); |
| 181 | 181 | ||
| 182 | __local_bh_disable((unsigned long)__builtin_return_address(0)); | 182 | __local_bh_disable((unsigned long)__builtin_return_address(0)); |
| 183 | trace_softirq_enter(); | 183 | lockdep_softirq_enter(); |
| 184 | 184 | ||
| 185 | cpu = smp_processor_id(); | 185 | cpu = smp_processor_id(); |
| 186 | restart: | 186 | restart: |
| @@ -220,7 +220,7 @@ restart: | |||
| 220 | if (pending) | 220 | if (pending) |
| 221 | wakeup_softirqd(); | 221 | wakeup_softirqd(); |
| 222 | 222 | ||
| 223 | trace_softirq_exit(); | 223 | lockdep_softirq_exit(); |
| 224 | 224 | ||
| 225 | account_system_vtime(current); | 225 | account_system_vtime(current); |
| 226 | _local_bh_enable(); | 226 | _local_bh_enable(); |
diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c index 280332c1827c..619313ed6c46 100644 --- a/lib/locking-selftest.c +++ b/lib/locking-selftest.c | |||
| @@ -157,11 +157,11 @@ static void init_shared_classes(void) | |||
| 157 | #define SOFTIRQ_ENTER() \ | 157 | #define SOFTIRQ_ENTER() \ |
| 158 | local_bh_disable(); \ | 158 | local_bh_disable(); \ |
| 159 | local_irq_disable(); \ | 159 | local_irq_disable(); \ |
| 160 | trace_softirq_enter(); \ | 160 | lockdep_softirq_enter(); \ |
| 161 | WARN_ON(!in_softirq()); | 161 | WARN_ON(!in_softirq()); |
| 162 | 162 | ||
| 163 | #define SOFTIRQ_EXIT() \ | 163 | #define SOFTIRQ_EXIT() \ |
| 164 | trace_softirq_exit(); \ | 164 | lockdep_softirq_exit(); \ |
| 165 | local_irq_enable(); \ | 165 | local_irq_enable(); \ |
| 166 | local_bh_enable(); | 166 | local_bh_enable(); |
| 167 | 167 | ||
