aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds2013-03-05 20:10:04 -0600
committerLinus Torvalds2013-03-05 20:10:04 -0600
commite3b59518c10e08eeb06215abf06f50e8f83b51dc (patch)
treea1e5933192ee123883112d771e27e9c972ccd733
parent6516ab6fdffbda656253d4e1231660c3f87f7889 (diff)
parent4cd5d1115c2f752ca94a0eb461b36d88fb37ed1e (diff)
downloadam43-linux-kernel-e3b59518c10e08eeb06215abf06f50e8f83b51dc.tar.gz
am43-linux-kernel-e3b59518c10e08eeb06215abf06f50e8f83b51dc.tar.xz
am43-linux-kernel-e3b59518c10e08eeb06215abf06f50e8f83b51dc.zip
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.h2
-rw-r--r--kernel/softirq.c21
2 files changed, 9 insertions, 14 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 29eb805ea4a..c1d6555d256 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 b4d252fd195..14d7758074a 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -323,18 +323,10 @@ void irq_enter(void)
323 323
324static inline void invoke_softirq(void) 324static 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 */
343void irq_exit(void) 335void 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/*