mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: "Björn Steinbrink" <B.Steinbrink@gmx.de>
Cc: linux-kernel@vger.kernel.org, Mike Galbraith <efault@gmx.de>,
	danial_thom@yahoo.com, Linus Torvalds <torvalds@osdl.org>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] i386: Fix softirq accounting with 4K stacks
Date: Sun, 25 Jun 2006 17:15:18 +0200	[thread overview]
Message-ID: <1151248518.4940.29.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <20060625142440.GD8223@atjola.homenet>

On Sun, 2006-06-25 at 16:24 +0200, Björn Steinbrink wrote:
> 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>
> 
> diff -Nurp a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c
> --- a/arch/i386/kernel/irq.c	2006-03-20 06:53:29.000000000 +0100
> +++ b/arch/i386/kernel/irq.c	2006-06-25 15:49:52.000000000 +0200
> @@ -95,6 +95,14 @@ fastcall unsigned int do_IRQ(struct pt_r
>  		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"

Hi,

at first I got nervous about the asymmetry of this (eg why only do this
copying only on entry, and not a copy back on exit)... but then again
these bits shouldn't change so your patch is ok as is...
it's regrettable that we need to add this for the softirq accounting;
part of me wishes we would just count irq-vs-user time and be done with
it ;)


Acked-by: Arjan van de Ven <arjan@linux.intel.com>


  reply	other threads:[~2006-06-25 15:15 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-22 15:26 Measuring tools - top and interrupts Danial Thom
2006-06-22 16:19 ` Randy.Dunlap
2006-06-22 17:16   ` Bernd Eckenfels
2006-06-22 16:21 ` Erik Mouw
2006-06-22 16:58   ` Danial Thom
2006-06-22 17:31     ` Erik Mouw
2006-06-22 23:37       ` Danial Thom
2006-06-23  8:32         ` Mike Galbraith
2006-06-23 20:14           ` Danial Thom
2006-06-23 22:51             ` Mike Galbraith
2006-06-23  9:02         ` Erik Mouw
2006-06-23 17:13         ` Alistair John Strachan
2006-06-23 18:16           ` Danial Thom
2006-06-23  5:34       ` sena seneviratne
2006-06-23 20:42       ` Danial Thom
2006-06-22 17:57     ` Francois Romieu
2006-06-22 22:47       ` Danial Thom
2006-06-22 23:53         ` Francois Romieu
2006-06-23 20:34           ` Danial Thom
2006-06-23 21:19             ` Francois Romieu
2006-06-24  2:07     ` Björn Steinbrink
2006-06-24  4:39       ` sena seneviratne
2006-06-24  5:59     ` Mike Galbraith
2006-06-24  6:26       ` Mike Galbraith
2006-06-24  9:21         ` Björn Steinbrink
2006-06-24  9:51           ` Mike Galbraith
2006-06-24 11:41             ` Mike Galbraith
2006-06-24 15:40               ` Björn Steinbrink
2006-06-24 16:23                 ` Mike Galbraith
2006-06-24 19:25                   ` Björn Steinbrink
2006-06-25  5:06                     ` Mike Galbraith
2006-06-25 11:12                       ` Björn Steinbrink
2006-06-25 14:24                         ` [PATCH] i386: Fix softirq accounting with 4K stacks Björn Steinbrink
2006-06-25 15:15                           ` Arjan van de Ven [this message]
2006-06-25 17:44                           ` Mike Galbraith
2006-06-25 17:43                             ` Arjan van de Ven
2006-06-25 18:42                               ` Björn Steinbrink
2006-06-26  2:23                                 ` Mike Galbraith
2006-06-26  3:05                                   ` Mike Galbraith
2006-06-26 17:58                                     ` Björn Steinbrink
2006-06-27 10:09                                       ` Mike Galbraith
2006-06-25 20:45                         ` Measuring tools - top and interrupts Danial Thom
2006-06-26  2:33                           ` Mike Galbraith
2006-06-30 13:41                             ` Danial Thom
2006-06-30 18:03                               ` Mike Galbraith
2006-06-26 22:54 [PATCH] i386: Fix softirq accounting with 4K stacks Chuck Ebbert
2006-06-27  0:57 ` Björn Steinbrink

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1151248518.4940.29.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=B.Steinbrink@gmx.de \
    --cc=akpm@osdl.org \
    --cc=danial_thom@yahoo.com \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®