Commit e3b59518 authored by Linus Torvalds's avatar Linus Torvalds

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 e5ab012c ("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
parents 6516ab6f 4cd5d111
...@@ -118,10 +118,8 @@ ...@@ -118,10 +118,8 @@
#ifdef CONFIG_PREEMPT_COUNT #ifdef CONFIG_PREEMPT_COUNT
# define preemptible() (preempt_count() == 0 && !irqs_disabled()) # define preemptible() (preempt_count() == 0 && !irqs_disabled())
# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
#else #else
# define preemptible() 0 # define preemptible() 0
# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
#endif #endif
#if defined(CONFIG_SMP) || defined(CONFIG_GENERIC_HARDIRQS) #if defined(CONFIG_SMP) || defined(CONFIG_GENERIC_HARDIRQS)
......
...@@ -323,18 +323,10 @@ void irq_enter(void) ...@@ -323,18 +323,10 @@ void irq_enter(void)
static inline void invoke_softirq(void) static inline void invoke_softirq(void)
{ {
if (!force_irqthreads) { if (!force_irqthreads)
#ifdef __ARCH_IRQ_EXIT_IRQS_DISABLED
__do_softirq(); __do_softirq();
#else else
do_softirq();
#endif
} else {
__local_bh_disable((unsigned long)__builtin_return_address(0),
SOFTIRQ_OFFSET);
wakeup_softirqd(); wakeup_softirqd();
__local_bh_enable(SOFTIRQ_OFFSET);
}
} }
/* /*
...@@ -342,9 +334,15 @@ static inline void invoke_softirq(void) ...@@ -342,9 +334,15 @@ static inline void invoke_softirq(void)
*/ */
void irq_exit(void) void irq_exit(void)
{ {
#ifndef __ARCH_IRQ_EXIT_IRQS_DISABLED
local_irq_disable();
#else
WARN_ON_ONCE(!irqs_disabled());
#endif
account_irq_exit_time(current); account_irq_exit_time(current);
trace_hardirq_exit(); trace_hardirq_exit();
sub_preempt_count(IRQ_EXIT_OFFSET); sub_preempt_count(HARDIRQ_OFFSET);
if (!in_interrupt() && local_softirq_pending()) if (!in_interrupt() && local_softirq_pending())
invoke_softirq(); invoke_softirq();
...@@ -354,7 +352,6 @@ void irq_exit(void) ...@@ -354,7 +352,6 @@ void irq_exit(void)
tick_nohz_irq_exit(); tick_nohz_irq_exit();
#endif #endif
rcu_irq_exit(); rcu_irq_exit();
sched_preempt_enable_no_resched();
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment