diff options
Diffstat (limited to 'kernel/softirq.c')
-rw-r--r-- | kernel/softirq.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/kernel/softirq.c b/kernel/softirq.c index 0f08a84ae307..3789ca98197c 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
@@ -65,6 +65,7 @@ static inline void wakeup_softirqd(void) | |||
65 | * This one is for softirq.c-internal use, | 65 | * This one is for softirq.c-internal use, |
66 | * where hardirqs are disabled legitimately: | 66 | * where hardirqs are disabled legitimately: |
67 | */ | 67 | */ |
68 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
68 | static void __local_bh_disable(unsigned long ip) | 69 | static void __local_bh_disable(unsigned long ip) |
69 | { | 70 | { |
70 | unsigned long flags; | 71 | unsigned long flags; |
@@ -80,6 +81,13 @@ static void __local_bh_disable(unsigned long ip) | |||
80 | trace_softirqs_off(ip); | 81 | trace_softirqs_off(ip); |
81 | raw_local_irq_restore(flags); | 82 | raw_local_irq_restore(flags); |
82 | } | 83 | } |
84 | #else /* !CONFIG_TRACE_IRQFLAGS */ | ||
85 | static inline void __local_bh_disable(unsigned long ip) | ||
86 | { | ||
87 | add_preempt_count(SOFTIRQ_OFFSET); | ||
88 | barrier(); | ||
89 | } | ||
90 | #endif /* CONFIG_TRACE_IRQFLAGS */ | ||
83 | 91 | ||
84 | void local_bh_disable(void) | 92 | void local_bh_disable(void) |
85 | { | 93 | { |
@@ -121,12 +129,16 @@ EXPORT_SYMBOL(_local_bh_enable); | |||
121 | 129 | ||
122 | void local_bh_enable(void) | 130 | void local_bh_enable(void) |
123 | { | 131 | { |
132 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
124 | unsigned long flags; | 133 | unsigned long flags; |
125 | 134 | ||
126 | WARN_ON_ONCE(in_irq()); | 135 | WARN_ON_ONCE(in_irq()); |
136 | #endif | ||
127 | WARN_ON_ONCE(irqs_disabled()); | 137 | WARN_ON_ONCE(irqs_disabled()); |
128 | 138 | ||
139 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
129 | local_irq_save(flags); | 140 | local_irq_save(flags); |
141 | #endif | ||
130 | /* | 142 | /* |
131 | * Are softirqs going to be turned on now: | 143 | * Are softirqs going to be turned on now: |
132 | */ | 144 | */ |
@@ -142,18 +154,22 @@ void local_bh_enable(void) | |||
142 | do_softirq(); | 154 | do_softirq(); |
143 | 155 | ||
144 | dec_preempt_count(); | 156 | dec_preempt_count(); |
157 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
145 | local_irq_restore(flags); | 158 | local_irq_restore(flags); |
159 | #endif | ||
146 | preempt_check_resched(); | 160 | preempt_check_resched(); |
147 | } | 161 | } |
148 | EXPORT_SYMBOL(local_bh_enable); | 162 | EXPORT_SYMBOL(local_bh_enable); |
149 | 163 | ||
150 | void local_bh_enable_ip(unsigned long ip) | 164 | void local_bh_enable_ip(unsigned long ip) |
151 | { | 165 | { |
166 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
152 | unsigned long flags; | 167 | unsigned long flags; |
153 | 168 | ||
154 | WARN_ON_ONCE(in_irq()); | 169 | WARN_ON_ONCE(in_irq()); |
155 | 170 | ||
156 | local_irq_save(flags); | 171 | local_irq_save(flags); |
172 | #endif | ||
157 | /* | 173 | /* |
158 | * Are softirqs going to be turned on now: | 174 | * Are softirqs going to be turned on now: |
159 | */ | 175 | */ |
@@ -169,7 +185,9 @@ void local_bh_enable_ip(unsigned long ip) | |||
169 | do_softirq(); | 185 | do_softirq(); |
170 | 186 | ||
171 | dec_preempt_count(); | 187 | dec_preempt_count(); |
188 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
172 | local_irq_restore(flags); | 189 | local_irq_restore(flags); |
190 | #endif | ||
173 | preempt_check_resched(); | 191 | preempt_check_resched(); |
174 | } | 192 | } |
175 | EXPORT_SYMBOL(local_bh_enable_ip); | 193 | EXPORT_SYMBOL(local_bh_enable_ip); |
@@ -547,7 +565,7 @@ static void takeover_tasklets(unsigned int cpu) | |||
547 | } | 565 | } |
548 | #endif /* CONFIG_HOTPLUG_CPU */ | 566 | #endif /* CONFIG_HOTPLUG_CPU */ |
549 | 567 | ||
550 | static int __devinit cpu_callback(struct notifier_block *nfb, | 568 | static int __cpuinit cpu_callback(struct notifier_block *nfb, |
551 | unsigned long action, | 569 | unsigned long action, |
552 | void *hcpu) | 570 | void *hcpu) |
553 | { | 571 | { |
@@ -587,7 +605,7 @@ static int __devinit cpu_callback(struct notifier_block *nfb, | |||
587 | return NOTIFY_OK; | 605 | return NOTIFY_OK; |
588 | } | 606 | } |
589 | 607 | ||
590 | static struct notifier_block __devinitdata cpu_nfb = { | 608 | static struct notifier_block __cpuinitdata cpu_nfb = { |
591 | .notifier_call = cpu_callback | 609 | .notifier_call = cpu_callback |
592 | }; | 610 | }; |
593 | 611 | ||