linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Schwebel <r.schwebel@pengutronix.de>
To: Marco Stornelli <marco.stornelli@gmail.com>
Cc: Michael Schnell <mschnell@lumino.de>, linux-embedded@vger.kernel.org
Subject: Re: AMP on an SMP system
Date: Sat, 3 Aug 2013 21:11:49 +0200	[thread overview]
Message-ID: <20130803191149.GU3880@pengutronix.de> (raw)
In-Reply-To: <51FBC7FE.4000403@gmail.com>

Hi,

On Fri, Aug 02, 2013 at 04:53:50PM +0200, Marco Stornelli wrote:
> > In fact I need a way to do very guaranteed low latency. regarding the
> > high clock rate (about 1 GHz) modern ARM chips can provide, maybe
> > preempt-rt with the cpu affinity might be a decent way to go.

Modern hardware has lots of features which makes them basically not
deterministic.

One recent example: on MX6 (quadcore Cortex-A9), when you run a certain
cpuburn tool, the temperature rises up to the maximum allowed value in
just a couple of seconds, and then you either have the choice to burn
your hardware or to use the tempmon interrupt to throttle down the speed
of the cpu. You can imagine what all that means for latencies.

So if you want to use a reasonably modern hardware, it is always a
matter of "high system probability" of not missing a cycle.

> Just to be clear: at the moment there isn't an easy way to dedicate
> "completely" a cpu for a task. The last time I tried (some years ago
> actually) to use exclusive cpu set, the scheduler didn't do a good
> work because it was designed for SMP, not SMP minus some piece.
> However you can try and you can report your results. It would be
> interesting.

Without having done some tests myself, I would expect that the -rt folks
have such scenarios.

> > The raining questions include
> >   - how to calculate the maximum latency that can be guaranteed ? (i.e.
> > does the Kernel impose any spinlocks and interrupt disables on the would
> > be AMP subsystem ?)

You can't. And you can't, even if you try to run bare-metal software on
a dedicated core. I can't imagine how for example the cache influences
between the cores could be determined.

> No. You can use full dyn tick for example to disable timer
> interrupt, but it has got some pros and cons, especially with very
> low latency requirement.
> 
> >  - how to assign an interrupt (e.g. a dedicated timer) to the subsystem ?
> 
> Interrupt handler are kernel thread, so you can schedule your kernel
> thread on your "normal" cpu.

The really great thing with preempt-rt is that it is all Linux and
POSIX. No need to invent new things like program starters, inter-
process-communication and even inter-processor-communication.
 
> >  - Do the interrupts immediately call the ISR of the cpu "under
> >affinity" or is some additional latency imposed by the Kernel
> 
> AFAIC, no latency for cpu "under affinity".
> 
> >(and how
> >many cpu cycles at max are needed to enter the ISR) ?
> 
> It's difficult to answer to this question because the performance
> depends on your system. From my last statistics I saw that with an
> rt linux kernel you can stay below 50us for the interrupt latency.

Here is an MX53 (single core cortex-a8) in the OSADL testlab:
https://www.osadl.org/Latency-plot-of-system-in-rack-0-slot.qa-latencyplot-r0s5.0.html

But note that multicore is quite different. I'd suggest that you measure
yourself.

rsc
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  parent reply	other threads:[~2013-08-03 19:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-02  8:33 AMP on an SMP system Michael Schnell
2013-08-02 11:42 ` Robert Schwebel
2013-08-02 12:13   ` Michael Schnell
2013-08-02 14:53     ` Marco Stornelli
2013-08-02 15:24       ` Michael Schnell
2013-08-02 15:37         ` Marco Stornelli
2013-08-02 16:00           ` Michael Schnell
2013-08-02 15:58             ` Marco Stornelli
2013-08-03 19:11       ` Robert Schwebel [this message]
2013-08-05  7:25         ` Michael Schnell
2013-08-05  8:17           ` Robert Schwebel
2013-08-05  9:04             ` Michael Schnell
2013-08-04 21:28 ` Lambrecht Jürgen
2013-08-05  7:36   ` Michael Schnell
2013-08-05 10:00   ` Lambrecht Jürgen
2013-08-07  8:23     ` Michael Schnell
2013-08-07  8:29       ` Michael Schnell
2013-08-07  9:04       ` Michael Schnell
2013-08-08  7:41 ` Michael Schnell
  -- strict thread matches above, loose matches on Subject: below --
2013-08-02 16:16 Jon Sevy
2013-08-05  7:45 ` Michael Schnell
2013-08-05  8:21   ` Robert Schwebel
2013-08-05  8:42     ` Michael Schnell
2013-08-05  9:06 Guenter Ebermann
2013-08-05  9:34 ` Michael Schnell

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=20130803191149.GU3880@pengutronix.de \
    --to=r.schwebel@pengutronix.de \
    --cc=linux-embedded@vger.kernel.org \
    --cc=marco.stornelli@gmail.com \
    --cc=mschnell@lumino.de \
    /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;
as well as URLs for NNTP newsgroup(s).