All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Manuel Huber <manuel.h87@gmail.com>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] Decrease Latency (below 10 us) on x32 or x32_64?
Date: Tue, 19 Mar 2013 21:46:33 +0100	[thread overview]
Message-ID: <5148CEA9.7060700@xenomai.org> (raw)
In-Reply-To: <5148C728.6000101@gmail.com>

On 03/19/2013 09:14 PM, Manuel Huber wrote:

> Hello!
> 
> We use a AMD FX-61000 CPU together with Xenomai 2.6.2.1 and Kernel
> 3.5.7 (thanks to Jan Kiszka) and I was wondering if it's possible to
> further decrease the latency of the system. I currently can get more
> than 30 us when interacting with the system.
> 
> My first guess was the graphics card + graphics card driver because I
> read about such problems and tested another graphics card which caused
> a huge amount of extra-latency... I tried to get the real system
> latency by booting the system in recovery mode (single) with vga=792
> option + setting the nouveau driver on the blacklist... This seems to
> work, but I still get roughly the same latencies (>20us) even after
> 1hour by using the latency program in interrupt mode (-t 2). Only a
> few times the latency grows beyond 10us but still it does... I have
> unplugged the usb mouse and keyboard before running the test and
> started ten instances of burnK7 with nice -n -20.  I also tried
> booting with isolcpus=2,3 and assigned the latency program to cpu 3
> (-c 3). This didn't really improve the worst case latency (still the
> same setup as above, no gui, single). Is it possible to further
> decrease latency (especially worst case latency) by using one cpu just
> for real-time tasks? Is there some other way to keep Linux from using
> a core?
> 
> The next thing I want to test is using 64bits; It seems rational that
> using 32 bits with 16GB ram causes some extra latencies but is it
> possible that it causes about 10 us extra? Is there some other option
> I can tune? I know that the I-Pipe system isn't trivial but to me,
> using interrupts seems pretty low-level and I would expect this to
> have minimal latency (and jitter). I don't want to complain, it's just
> that my supervisor asked me about the source of the latency and I
> can't really explain... After having read just about all papers
> about I-Pipe, I still don't have a deep understanding of the system.
> Is there a good reference I missed?


First, to know where the latency comes from, enable the I-pipe tracer,
and run latency with the "-f" option.

Now, common ways to reduce latencies are:
- optimize the kernel for size
- disable high res timers, you can try fiddling with the various preempt
settings, this used to have a big impact on code size, but with the
"optimize for size" option, they no longer seem to have one.
- check what the processor does when idle; if it enters C1 state, try to
avoid that with the BIOS settings, or pass "nohlt" on the kernel command
line.

But of course, what you should do probably depends on the I-pipe tracer
results. And to really know what your worst case latency is, you should
always run the test the same time with the same load, you can use
xeno-test for that.

-- 
                                                                Gilles.


  reply	other threads:[~2013-03-19 20:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-19 20:14 [Xenomai] Decrease Latency (below 10 us) on x32 or x32_64? Manuel Huber
2013-03-19 20:46 ` Gilles Chanteperdrix [this message]
2013-03-26 10:18   ` Manuel Huber
2013-03-26 11:57     ` Gilles Chanteperdrix
2013-03-28 10:06       ` Manuel Huber
2013-03-28 12:46         ` Gilles Chanteperdrix
2013-03-28 13:04           ` Manuel Huber
2013-03-28 20:24             ` Gilles Chanteperdrix
2013-04-02 17:49               ` Manuel Huber
2013-04-02 22:20                 ` Gilles Chanteperdrix
2013-04-13 16:42   ` Gilles Chanteperdrix
2013-04-18  5:51     ` Manuel Huber

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=5148CEA9.7060700@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=manuel.h87@gmail.com \
    --cc=xenomai@xenomai.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.