All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Charles Steinkuehler <charles@steinkuehler.net>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] Dedicated Core?
Date: Mon, 31 Mar 2014 01:22:24 +0200	[thread overview]
Message-ID: <5338A730.6010601@xenomai.org> (raw)
In-Reply-To: <533894D3.8090803@steinkuehler.net>

On 03/31/2014 12:04 AM, Charles Steinkuehler wrote:
> On 3/30/2014 4:41 PM, Gilles Chanteperdrix wrote:
>> 
>> First, the imx6 is reported to have high latencies, and it is
>> mostly due to cache effects, so isolating the cpus will not
>> help.
>> 
>> Second, I would say relying on low user-space latencies to do in 
>> user-space things that the kernel should do is a bad design. You
>> would have better success implementing the step motor control low
>> level details as a kernel driver, and only move the high level
>> stuff in user-space.
> 
> I am not looking to migrate something that should be a kernel
> service, instead I'm trying to replace having dedicated hardware.

This is better done in kernel-space than in user-space. At least, you
should give a try to a kernel driver before you decide to resort to
what you want to do.

Besides, notably the L2 cache issues on imx6, make it impossible for
the activity on one core to not influence the activity on other cores.

> 
>>> If it would be possible to simply keep a thread running
>>> full-time on one core, I could get really good step/direction
>>> performance without having to worry about interrupt latency,
>>> but I don't know if there's an (easy) way to do this using
>>> Xenomai, or if the 'dedicated' core would still be subject to
>>> hardware interrupts and if my running thread might be 
>>> occasionally migrated to other physical cores.
>> 
>> The latency you get in user-spâce are not interrupt latency, but 
>> user-space scheduling latencies, which are significantly higher.
>> See the difference between latency -t 0 and latency -t 2 on your
>> plaforms. If you want to only depend on interrupt latencies, you
>> should implement a driver, and get user-space to interact with
>> the driver.
>> 
>> As you may have already read on this list, Xenomai never migrates
>> task automatically, and you can change the task affinity to
>> define on which core it should run. That said, you probably want
>> the processor to remain interrupt triggered, and the real-time
>> task to suspend from time to time to let linux do its duty (like
>> handling Linux domain timer interrupts).
> 
> We already have hooks to set processor affinity.  What I am
> interested in is if I dedicate an entire core to running a tight
> code loop, can I avoid Xenomai and/or Linux "pulling the core out
> from under me" as a result of various hardware interrupts or
> general task scheduling?
> 
> I can live with the code not running for the duration of the
> Xenomai interrupt handler (that's happening now anyway), I just
> want to know if it is (easy) to keep Xenomai and Linux from
> grabbing the core running my tight loop after the interrupt event.
> It's similar to having one core running "bare metal" code, but I
> actually need Linux and Xenomai to manage setting up the shared
> memory regions used for IPC prior to launching my code.
> 

As I said, the answer is no, Linux needs to answer to some events on
all the cores that are not turned off, and Xenomai can not run on a
turned off core.



-- 
                                                                Gilles.


  parent reply	other threads:[~2014-03-30 23:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-30 20:49 [Xenomai] Dedicated Core? Charles Steinkuehler
2014-03-30 21:41 ` Gilles Chanteperdrix
2014-03-30 22:04   ` Charles Steinkuehler
2014-03-30 23:20     ` Lennart Sorensen
2014-03-30 23:22     ` Gilles Chanteperdrix [this message]
2014-03-31 11:29     ` Gilles Chanteperdrix
2014-03-31 12:19       ` Andy Pugh
2014-03-31 12:24         ` Gilles Chanteperdrix

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=5338A730.6010601@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=charles@steinkuehler.net \
    --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.