RE: Measuring timer interrupt latency

Suresh Kumar SHUKLA
2009-04-14T03:56:29Z

Hi Clark,

I already captured cyclictest (0.34) results. Thanks for new version info.

It would be interesting to see the benefits of RT patch in ISR latency (#1)
scenarios.
Tim Sander's LMM seems perfectly suitable for this.

regards,
Suresh

-----Original Message-----
From: linux-rt-users-owner@vger.kernel.org
[mailto:linux-rt-users-owner@vger.kernel.org] On Behalf Of Clark Williams
Sent: Monday, April 13, 2009 7:44 PM
To: Suresh Kumar SHUKLA
Cc: 'rt-users'
Subject: Re: Measuring timer interrupt latency

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 13 Apr 2009 12:14:42 +0530
Suresh Kumar SHUKLA <suresh.shukla@st.com> wrote:

> Hi,
>
> I want to profile the improvements in interrupt latency with and
> without RT patches.
>
> The approach I have in mind is that time gap between IRQ firing and
> IRQ handler reading value of counter would be sufficient to reveal the
> interrupt latency. These values can be analysed for min/max/avg.
>
> Is there any test program which captures interrupt latency (for x86) ?
> I checked realfeel but it is user mode program and am not sure of its
> accuracy.
>
> regards,
> Suresh
>

Have you tried cyclictest? It's part of the rt-tests package that Thomas
Gleixner wrote and that I now maintain.

You can pick up the latest tarball here:

http://www.kernel.org/pub/linux//kernel/people/clrkwllms/rt-tests/rt-tests-0
.35.tar.bz2

The thing is, I'm not sure how useful measuring the interval between
interrupt and ISR. It's such a small component of the total latency value
that it usually gets lost in the noise. Cyclictest measures the time between
a timer fires and when the user-space program (cyclictest) actually gets to
run after a sleep, which is the entire latency value.
What you're talking about measuring on RT is basically a lookup and
schedule() call, since all interrupts have threaded handlers on RT.

If you are wanting to decompose the latency into it's components on RT, I
think you'd have:

1. ISR latency
2. Scheduler latency for IRQ thread
3. IRQ handler time
4. Scheduler latency for user-space thread

Cyclictest measures the aggregate of all these.

Clark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (GNU/Linux)

iEYEARECAAYFAknjSLEACgkQHyuj/+TTEp1kuACfSi13WaRt6nZDc53LXWqSsbsK
Tv0AoJHpeXAjOkCPu5yBMElNDMr3Ij0y
=5LIa
-----END PGP SIGNATURE-----
N
'2flr8^[yzh\x1aXb2X,6G'vX^\x16)^:{.nG+ 7%
{1.[,z;"\x1e
X^n r!v&zK\x1a\x01kh\x19(h-Z&"x\x1e
.G+\x1d
ih.\x03(-i\x1a\x0e ]"j"\x1d
z\x1a6^[m'\x7fo\x01jdz9^\x16
`~f#"7h\x1a\b'~\bm