From: Björn Steinbrink Date: Sun, 25 Jun 2006 14:24:40 +0000 (+0200) Subject: [PATCH] i386: Fix softirq accounting with 4K stacks X-Git-Tag: v2.6.18-rc1~860 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5d157e0675ac11188a8d429a062b1938bb2d353;p=pandora-kernel.git [PATCH] i386: Fix softirq accounting with 4K stacks Copy the softirq bits in preempt_count from the current context into the hardirq context when using 4K stacks to make the softirq_count macro work correctly and thereby fix softirq cpu time accounting. Signed-off-by: Björn Steinbrink Acked-by: Arjan van de Ven Signed-off-by: Linus Torvalds --- diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c index 248e922ee13a..49ce4c31b713 100644 --- a/arch/i386/kernel/irq.c +++ b/arch/i386/kernel/irq.c @@ -95,6 +95,14 @@ fastcall unsigned int do_IRQ(struct pt_regs *regs) irqctx->tinfo.task = curctx->tinfo.task; irqctx->tinfo.previous_esp = current_stack_pointer; + /* + * Copy the softirq bits in preempt_count so that the + * softirq checks work in the hardirq context. + */ + irqctx->tinfo.preempt_count = + irqctx->tinfo.preempt_count & ~SOFTIRQ_MASK | + curctx->tinfo.preempt_count & SOFTIRQ_MASK; + asm volatile( " xchgl %%ebx,%%esp \n" " call __do_IRQ \n"