All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clark Williams <williams@redhat.com>
To: "Jürgen Lanner" <jue.lanner@gmx.at>
Cc: Stanislav Meduna <stano@meduna.org>, linux-rt-users@vger.kernel.org
Subject: Re: Measuring scheduling latency for RT threads
Date: Wed, 19 Nov 2014 11:59:12 -0600	[thread overview]
Message-ID: <20141119115912.2a2a0565@sluggy> (raw)
In-Reply-To: <546C98F5.1020103@meduna.org>

[-- Attachment #1: Type: text/plain, Size: 1581 bytes --]

On Wed, 19 Nov 2014 14:19:49 +0100
Stanislav Meduna <stano@meduna.org> wrote:

> On 19.11.2014 13:43, "Jürgen Lanner" wrote:
> 
> > My first goal is to find out about the worst case latency:
> > Is there a way I can find out how long (worst case) a RT thread
> > being ready to run is just waiting to be dispatched?  
> 
> ftrace, trace-cmd, kernelshark
> 
> The latency for the highest prio runnable task is available
> right away with the wakeup tracer. For other tasks you can
> trace the scheduling functions and interpret the results
> using a script (or look at them graphically using kernelshark).
> 
> Note that the function tracing is not free and will skew
> the results a bit, but should be good enough to identify
> the offenders.
> 

You might want to establish a baseline of what the expected latency on
your hardware will be. Try the 'cyclictest' application from the
rt-tests package. Run that for some number of hours to see if you have
any hardware issues that may cause delays. 

When run this way:

	$ sudo cyclictest --numa -p95 -mu

The program will kick off a measurement thread at fifo:95 on each
online core. It will the loop until you kill it with ^c, sleeping for
an interval and then measuring the delta between ideal wakeup time and
actual wakeup time of the measurement thread, something like this:

	t1 = gettime()
	loop:
		sleep(interval)
		t2=gettime()
		delta = t2 - (t1+interval)
		print delta
		t1=gettime()
		goto loop

That will show you the actual scheduling latency seen on each core. 

Clark

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2014-11-19 17:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19 12:43 Measuring scheduling latency for RT threads "Jürgen Lanner"
2014-11-19 13:11 ` Bernhard Schiffner
2014-11-19 13:19 ` Stanislav Meduna
2014-11-19 17:59   ` Clark Williams [this message]

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=20141119115912.2a2a0565@sluggy \
    --to=williams@redhat.com \
    --cc=jue.lanner@gmx.at \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=stano@meduna.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.