Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8d490c3 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge branch 'irq/core-v6' of...

Merge branch 'irq/core-v6' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into irq/core

Pull hardirq and softirq nesting updates from Frederic Weisbecker,
which fix nesting related stack overruns such as:

  http://lkml.kernel.org/r/1378330796.4321.50.camel%40pasglop



Beyond being a fix, this series also optimizes and reorganizes arch
hardirq/softirq stack processing to be faster and more robust.

Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 8a60d42d 62d26c82
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -390,6 +390,16 @@ config HAVE_UNDERSCORE_SYMBOL_PREFIX
	  Some architectures generate an _ in front of C symbols; things like
	  module loading and assembly files need to know about this.

config HAVE_IRQ_EXIT_ON_IRQ_STACK
	bool
	help
	  Architecture doesn't only execute the irq handler on the irq stack
	  but also irq_exit(). This way we can process softirqs on this irq
	  stack instead of switching to a new one when we call __do_softirq()
	  in the end of an hardirq.
	  This spares a stack switch and improves cache usage on softirq
	  processing.

#
# ABI hall of shame
#
+19 −33
Original line number Diff line number Diff line
@@ -159,19 +159,12 @@ void irq_ctx_exit(int cpu)

extern asmlinkage void __do_softirq(void);

asmlinkage void do_softirq(void)
void do_softirq_own_stack(void)
{
	unsigned long flags;
	struct thread_info *curctx;
	union irq_ctx *irqctx;
	u32 *isp;

	if (in_interrupt())
		return;

	local_irq_save(flags);

	if (local_softirq_pending()) {
	curctx = current_thread_info();
	irqctx = softirq_ctx[smp_processor_id()];
	irqctx->tinfo.task = curctx->task;
@@ -190,13 +183,6 @@ asmlinkage void do_softirq(void)
		  "D1Ar5", "D0Ar6", "D0Re0", "D1Re0", "D0.4", "D1RtP",
		  "D0.5"
		);
		/*
		 * Shouldn't happen, we returned above if in_interrupt():
		 */
		WARN_ON_ONCE(softirq_count());
	}

	local_irq_restore(flags);
}
#endif

+2 −15
Original line number Diff line number Diff line
@@ -499,22 +499,9 @@ static void execute_on_irq_stack(void *func, unsigned long param1)
	*irq_stack_in_use = 1;
}

asmlinkage void do_softirq(void)
void do_softirq_own_stack(void)
{
	__u32 pending;
	unsigned long flags;

	if (in_interrupt())
		return;

	local_irq_save(flags);

	pending = local_softirq_pending();

	if (pending)
	execute_on_irq_stack(__do_softirq, 0);

	local_irq_restore(flags);
}
#endif /* CONFIG_IRQSTACKS */

+1 −0
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@ config PPC
	select OLD_SIGSUSPEND
	select OLD_SIGACTION if PPC32
	select HAVE_DEBUG_STACKOVERFLOW
	select HAVE_IRQ_EXIT_ON_IRQ_STACK

config EARLY_PRINTK
	bool
+1 −16
Original line number Diff line number Diff line
@@ -593,7 +593,7 @@ void irq_ctx_init(void)
	}
}

static inline void do_softirq_onstack(void)
void do_softirq_own_stack(void)
{
	struct thread_info *curtp, *irqtp;

@@ -611,21 +611,6 @@ static inline void do_softirq_onstack(void)
		set_bits(irqtp->flags, &curtp->flags);
}

void do_softirq(void)
{
	unsigned long flags;

	if (in_interrupt())
		return;

	local_irq_save(flags);

	if (local_softirq_pending())
		do_softirq_onstack();

	local_irq_restore(flags);
}

irq_hw_number_t virq_to_hw(unsigned int virq)
{
	struct irq_data *irq_data = irq_get_irq_data(virq);
Loading