diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-05 21:10:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-05 21:10:04 -0500 |
commit | e3b59518c10e08eeb06215abf06f50e8f83b51dc (patch) | |
tree | a1e5933192ee123883112d771e27e9c972ccd733 | |
parent | 6516ab6fdffbda656253d4e1231660c3f87f7889 (diff) | |
parent | 4cd5d1115c2f752ca94a0eb461b36d88fb37ed1e (diff) |
Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fixes and cleanups from Thomas Gleixner:
"Commit e5ab012c3271 ("nohz: Make tick_nohz_irq_exit() irq safe") is
the first commit in the series and the minimal necessary bugfix, which
needs to go back into stable.
The remanining commits enforce irq disabling in irq_exit(), sanitize
the hardirq/softirq preempt count transition and remove a bunch of no
longer necessary conditionals."
I personally love getting rid of the very subtle and confusing
IRQ_EXIT_OFFSET thing. Even apart from the whole "more lines removed
than added" thing.
* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
irq: Don't re-enable interrupts at the end of irq_exit
irq: Remove IRQ_EXIT_OFFSET workaround
Revert "nohz: Make tick_nohz_irq_exit() irq safe"
irq: Sanitize invoke_softirq
irq: Ensure irq_exit() code runs with interrupts disabled
nohz: Make tick_nohz_irq_exit() irq safe
-rw-r--r-- | include/linux/hardirq.h | 2 | ||||
-rw-r--r-- | kernel/softirq.c | 21 |
2 files changed, 9 insertions, 14 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 29eb805ea4a6..c1d6555d2567 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -118,10 +118,8 @@ | |||
118 | 118 | ||
119 | #ifdef CONFIG_PREEMPT_COUNT | 119 | #ifdef CONFIG_PREEMPT_COUNT |
120 | # define preemptible() (preempt_count() == 0 && !irqs_disabled()) | 120 | # define preemptible() (preempt_count() == 0 && !irqs_disabled()) |
121 | # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) | ||
122 | #else | 121 | #else |
123 | # define preemptible() 0 | 122 | # define preemptible() 0 |
124 | # define IRQ_EXIT_OFFSET HARDIRQ_OFFSET | ||
125 | #endif | 123 | #endif |
126 | 124 | ||
127 | #if defined(CONFIG_SMP) || defined(CONFIG_GENERIC_HARDIRQS) | 125 | #if defined(CONFIG_SMP) || defined(CONFIG_GENERIC_HARDIRQS) |
diff --git a/kernel/softirq.c b/kernel/softirq.c index b4d252fd195b..14d7758074aa 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
@@ -323,18 +323,10 @@ void irq_enter(void) | |||
323 | 323 | ||
324 | static inline void invoke_softirq(void) | 324 | static inline void invoke_softirq(void) |
325 | { | 325 | { |
326 | if (!force_irqthreads) { | 326 | if (!force_irqthreads) |
327 | #ifdef __ARCH_IRQ_EXIT_IRQS_DISABLED | ||
328 | __do_softirq(); | 327 | __do_softirq(); |
329 | #else | 328 | else |
330 | do_softirq(); | ||
331 | #endif | ||
332 | } else { | ||
333 | __local_bh_disable((unsigned long)__builtin_return_address(0), | ||
334 | SOFTIRQ_OFFSET); | ||
335 | wakeup_softirqd(); | 329 | wakeup_softirqd(); |
336 | __local_bh_enable(SOFTIRQ_OFFSET); | ||
337 | } | ||
338 | } | 330 | } |
339 | 331 | ||
340 | /* | 332 | /* |
@@ -342,9 +334,15 @@ static inline void invoke_softirq(void) | |||
342 | */ | 334 | */ |
343 | void irq_exit(void) | 335 | void irq_exit(void) |
344 | { | 336 | { |
337 | #ifndef __ARCH_IRQ_EXIT_IRQS_DISABLED | ||
338 | local_irq_disable(); | ||
339 | #else | ||
340 | WARN_ON_ONCE(!irqs_disabled()); | ||
341 | #endif | ||
342 | |||
345 | account_irq_exit_time(current); | 343 | account_irq_exit_time(current); |
346 | trace_hardirq_exit(); | 344 | trace_hardirq_exit(); |
347 | sub_preempt_count(IRQ_EXIT_OFFSET); | 345 | sub_preempt_count(HARDIRQ_OFFSET); |
348 | if (!in_interrupt() && local_softirq_pending()) | 346 | if (!in_interrupt() && local_softirq_pending()) |
349 | invoke_softirq(); | 347 | invoke_softirq(); |
350 | 348 | ||
@@ -354,7 +352,6 @@ void irq_exit(void) | |||
354 | tick_nohz_irq_exit(); | 352 | tick_nohz_irq_exit(); |
355 | #endif | 353 | #endif |
356 | rcu_irq_exit(); | 354 | rcu_irq_exit(); |
357 | sched_preempt_enable_no_resched(); | ||
358 | } | 355 | } |
359 | 356 | ||
360 | /* | 357 | /* |