public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Iwo Mergler <iwo@call-direct.com.au>
To: Alessio Sangalli <alesan@manoweb.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: interrupt overhead on ARM architecture
Date: Tue, 29 Jul 2008 15:02:47 +1000	[thread overview]
Message-ID: <488EA477.7070101@call-direct.com.au> (raw)
In-Reply-To: <488E7F08.7060309@manoweb.com>

Alessio Sangalli wrote:
> Hi there, I was wondering if somebody ever did some measurements of the
> interrupt overhead, measured in clock cycles. Basically how much time it
> takes to do the context switch and reach the ISR, and back. My target is
> the ARM9...
> 
> Thanks
> Alessio
>
This depends very much on the system, both hardware and software.

The ARM9 processor can get from an active interrupt line to the
first instruction in the ISR in about 30 clock cycles.

However, it can take a multiple of that if the ISR and relevant
stacks are not in cache. On many systems this can cost you
a few hundred processor clocks, depending on what the software
did just before the interrupt.

At this point the OS ISR is running. It needs to find out which
hardware device triggered. The processor has only one interrupt
line (OK, two), but some systems have hundreds of interrupt sources.

Depending on the interrupt controller hardware, finding out which
interrupt fired, is a matter of reading one register in the best case.
Or reading several and searching for set bits in software in the
worst case. Again, a few tens of cycles, depending on the system
architecture.

Only then the OS ISR can actually call the driver's ISR, which
is probably what you are really interested in.

In other words, you can't even measure the latency on a particular
system and then assume it will stay anywhere near constant. Comparing
different systems with the same processor core is hopeless.


Kind regards,

Iwo



  reply	other threads:[~2008-07-29  5:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-29  2:23 interrupt overhead on ARM architecture Alessio Sangalli
2008-07-29  5:02 ` Iwo Mergler [this message]
2008-07-29  7:08   ` Alessio Sangalli
2008-07-29 10:47     ` Benjamin Herrenschmidt

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=488EA477.7070101@call-direct.com.au \
    --to=iwo@call-direct.com.au \
    --cc=alesan@manoweb.com \
    --cc=linux-kernel@vger.kernel.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