From: Julia Cartwright <julia@ni.com>
To: Jordan Palacios <jordan.palacios@pal-robotics.com>
Cc: linux-rt-users@vger.kernel.org
Subject: Re: Non RT threads impact on RT thread
Date: Tue, 22 May 2018 13:34:42 -0500 [thread overview]
Message-ID: <20180522183442.GP1403@jcartwri.amer.corp.natinst.com> (raw)
In-Reply-To: <CAGiv7G3sWoamRjg=ArLRi1eYYFJLY4bZvX2VQttMsw8DuVVScA@mail.gmail.com>
On Tue, May 22, 2018 at 12:00:27PM +0200, Jordan Palacios wrote:
> Hello,
Hello Jordan-
> We are currently running a version of the linux kernel (3.18.24) with
> the RT-PREEMPT patch. In our system there are several non RT tasks and
> one RT task. The RT process runs in the FIFO scheduler with 95
> priority and a control loop of 1ms.
>
> We have achieved latencies of about 5us which are perfect for us.
>
> Our issue is that the RT task sometimes misses one of its cycles due
> to an unexpected very long execution time of its control loop. In our
> system this is a critical failure.
>
> We enabled tracing in the kernel and started measuring the execution
> time of the RT thread. The execution time is quite constant (about
> 200us), which random spikes every now and then. Thing is, the less non
> RT tasks running in the system the better the RT task behaves.
>
> We wrote a very simple RT application that does some light work and
> writes its execution time using the trace_marker. Execution time is
> constant but IO intensive stuff, like a stress --io 32 or a hdparm,
> will have and impact on its execution time. This is surprising because
> the test does not any kind of work related to IO. Nor does the RT task
> in our system for that matter.
You haven't specified anything about your hardware setup, nor any
numbers here showing the magnitude of these latency spikes. Could you
elaborate?
> Our question is: Is this behaviour normal? Why are non RT tasks
> affecting the RT task performance? Is there any other kind of test
> that we could run that would shed some light on this issue?
I think it's "normal" that there will be _some_ impact from non-RT
tasks. Even across CPUs in the case where CPUs share some level of
cache. The question is what magnitude of impact should be expected.
Another thing you might want to look at is irq_smp_affinity, in the case
where your RT task is still serving interrupts it should not be.
Your test already has some scaffolding for tracing. Start a run with
tracing enabled and stop tracing once you observe a latency larger than
expected; dump the trace buffer; inspect.
Julia
next prev parent reply other threads:[~2018-05-22 18:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-22 10:00 Non RT threads impact on RT thread Jordan Palacios
2018-05-22 10:20 ` AW: " Lampersperger Andreas
2018-05-22 11:03 ` Jordan Palacios
2018-05-22 12:56 ` AW: " Gene Heskett
2018-05-22 12:51 ` Gene Heskett
2018-05-22 18:34 ` Julia Cartwright [this message]
2018-05-23 15:43 ` Jordan Palacios
2018-05-23 16:07 ` Julia Cartwright
2018-05-23 16:19 ` Jordan Palacios
2018-05-25 13:38 ` Jordan Palacios
2018-05-25 15:02 ` Julia Cartwright
2018-05-25 15:45 ` Jordan Palacios
2018-05-25 16:26 ` Julia Cartwright
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=20180522183442.GP1403@jcartwri.amer.corp.natinst.com \
--to=julia@ni.com \
--cc=jordan.palacios@pal-robotics.com \
--cc=linux-rt-users@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