All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Borkhuis <j.borkhuis@domain.hid>
To: rpm@xenomai.org
Cc: Xenomai-help@domain.hid
Subject: Re: [Xenomai-help] Unexpected switch to secondary mode
Date: Fri, 03 Aug 2007 10:05:07 +0200	[thread overview]
Message-ID: <46B2E1B3.2020102@domain.hid> (raw)
In-Reply-To: <1186053839.6611.326.camel@domain.hid>

Philippe,

(BTW: is this something that should be discussed in the Xenomai group, 
or would it be better to move this discussion to the Adeos mailing list?)

I do have question on this. We already discussed this problem earlier, 
and I managed to find a very dirty work around for my application: I 
added a lot of "dummy" functions to my application, which are spread 
over the whole application. By calling these after the mlockall, but 
before I switch to RT-mode I manage to eliminate most of the switches.

Philippe Gerum wrote:
> So it's unfortunately possible to experiment such switches on ppc hw for
> now. It is likely happening when the ns value is copied back to a user
> variable for which there is a PTE miss to handle in Linux kernel space
> first. Check the mail archive about "pte", "cow" (copy-on-write) and
> such things.
>   
As far as I know (but I can be incorrect here) an interrupt is generated 
due to a PTE-miss. This causes the Nucleus to switch to secondary mode, 
to allow Linux to process the PTE's. The total latency caused by this 
would not be very bad, as you also indicated earlier.

 From the earlier discussion:

    In such a case, you have likely hit an illustration of the latter issue
    which the I-pipe/ppc implementation still suffers from: some page table
    entries are missed during real-time operations. As a consequence of
    this, the nucleus catches page faults on behalf of RT threads in primary
    mode, then switches these threads back to secondary in order to process
    the faults, and eventually wire the missing PTEs in. This is something
    calling mlockall() does not prevent the application from (like COW).


Now for my question.
When looking at a situation where you have a system running multiple 
RT-tasks, when one of them hits an (unexpected) switch, it is possible 
that this task will never be switched in again, as the other RT-tasks 
might consume all the processor time.
Would it be possible to have the Nucleus, after the page-fault is 
processed and the "problem" is fixed, automagically switch the system 
back to primary mode?
It is not the real solution to the problem, but it would be a acceptable 
workaround for this moment, until a real solution is available.

Also another question on this issue: at this moment I am using kernel 
2.6.14(ppc), but I saw that there is now an adeos-patch for 
2.6.20(powerpc). Could using this version give an improvement in this 
area, or does this not make a difference?

Kind regards,
    Johan Borkhuis


  parent reply	other threads:[~2007-08-03  8:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-02  9:47 [Xenomai-help] Unexpected switch to secondary mode Johan Borkhuis
2007-08-02 10:12 ` Philippe Gerum
2007-08-02 10:54   ` Johan Borkhuis
2007-08-02 11:23     ` Philippe Gerum
2007-08-02 17:55       ` Gilles Chanteperdrix
2007-08-02 18:01         ` Philippe Gerum
2007-08-03  8:05       ` Johan Borkhuis [this message]
2007-08-05 17:22         ` Philippe Gerum
2007-08-06  9:08         ` Gilles Chanteperdrix
2007-08-06 11:41           ` Gilles Chanteperdrix
2007-08-07 11:06             ` Johan Borkhuis
2007-08-07 12:49               ` Gilles Chanteperdrix
2007-08-07 14:13                 ` Johan Borkhuis
2007-08-06 11:54           ` Philippe Gerum
     [not found]             ` <b647ffbd0708070758t22f01577wd3a5397a53249459@domain.hid>
2007-08-08  7:40               ` Dmitry Adamushko
2007-08-08  8:00                 ` Heikki Lindholm
2007-08-08  8:14                 ` Wolfgang Grandegger
2007-08-08  9:12                   ` Dmitry Adamushko
2007-08-08 10:13                     ` Wolfgang Grandegger
2007-08-04 12:30     ` Wolfgang Grandegger

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=46B2E1B3.2020102@domain.hid \
    --to=j.borkhuis@domain.hid \
    --cc=Xenomai-help@domain.hid \
    --cc=rpm@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.