Commit a5d157e0675ac11188a8d429a062b1938bb2d353

Authored by Björn Steinbrink
Committed by Linus Torvalds
1 parent 1d77062b14

[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 <B.Steinbrink@gmx.de>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 8 additions and 0 deletions Side-by-side Diff

arch/i386/kernel/irq.c
... ... @@ -95,6 +95,14 @@
95 95 irqctx->tinfo.task = curctx->tinfo.task;
96 96 irqctx->tinfo.previous_esp = current_stack_pointer;
97 97  
  98 + /*
  99 + * Copy the softirq bits in preempt_count so that the
  100 + * softirq checks work in the hardirq context.
  101 + */
  102 + irqctx->tinfo.preempt_count =
  103 + irqctx->tinfo.preempt_count & ~SOFTIRQ_MASK |
  104 + curctx->tinfo.preempt_count & SOFTIRQ_MASK;
  105 +
98 106 asm volatile(
99 107 " xchgl %%ebx,%%esp \n"
100 108 " call __do_IRQ \n"