From: "M. Koehrer" <mathias_koehrer@domain.hid>
To: eric.noulard@domain.hid, jweber@domain.hid
Cc: xenomai@xenomai.org
Subject: Re: Re: [Xenomai-help] isolating unwanted mode switch
Date: Thu, 25 Jan 2007 08:30:01 +0100 (CET) [thread overview]
Message-ID: <4080619.1169710201822.JavaMail.ngmail@domain.hid> (raw)
In-Reply-To: <cbe23c50701241055l5efa3f50p768f7d37d2d7cb8@domain.hid>
Hi all,
one other issue that comes in my mind:
The usage of C++ in a real time application could be fairly difficult, as
C++ might create temporary objects (using new(), which will probably
be realized with a malloc()). It is hard to identify what's happening with
the memory without an excellent understanding of the compiler.
That's why I try to avoid C++ and real time application and use plain C...
I do not know Jeff's application, however I think it could be worth to
have a look on that.
Regards
Mathias
> > On Wednesday 24 January 2007 04:08, Dmitry Adamushko wrote:
> > > On 23/01/07, Jeff Weber <jweber@domain.hid> wrote:
> > > > Dimitry:
> > > > > ...
> > > > > exceptions (CPU exceptions, e.g. page faults). I presume, you have
> > > > > done mlockall(CURRENT | FUTURE), haven't you?
> > > >
> > > > Yes. my Linux application follows this this model:
> > > >
> > > > main () {
> > > > mlockall(MCL_CURRENT | MCL_FUTURE);
> > > > rt_task_shadow( ... ) // become a realtime thread
> > > >
> > > > // for N threads:
> > > > rt_task_spawn( ... ) // fork off child RT thread
> > > > }
> > > >
> > > > It is one of the child RT threads that encounters the SIGXCPU
> unwanted
> > > > mode switch. It this the correct way to call mlockall() ?
> > >
> > > Looks ok. Just to avoid getting into the same trap twice. You don't
> > > use system(), fork() or alike beasts in your code, do you?
> > No.
> >
> > BTW, a primary mode thread in my application encountered the page fault
> > writing to the BSS segment.
>
> Are your variables all properly initialized, before mlockall ?
>
> >
> > How would my application encounter a page fault after calling
> > mlockall(CURRENT | FUTURE) ?
> >
> > Perhaps an answer is that mlockall() prevents pages from ever being paged
> out,
> > but the application may still encounter page faults upon referring to
> pages
> > that were never paged in when mlockall() was called. If true, then my
> > application may continue to encounter page faults, and hence switches to
> > seondary mode until all pages in the application are loaded.
>
> I am no Memory Handling expert nor Xenomai expert
> but I think you may get a page fault when you require more memory
> you used before you call mlockall(CURRENT | FUTURE),
> that is growing stack, mmap calls, malloc etc...
>
> Does you application has some unbounded or not pre-computed memory
> requirement (recursive call, malloc/calloc/alloca call etc.., mmap call)?
>
> I may imagine the case where your system is short of memory
> then you app requires more memory then you get page fault.
>
> As a simple check, did you verify your mlockall syscall succeed?
> I remember an application of mine which did not verify the returned
> code and discover later that the call did not succeed :(((
--
Mathias Koehrer
mathias_koehrer@domain.hid
Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: günstig
und schnell mit DSL - das All-Inclusive-Paket für clevere Doppel-Sparer,
nur 44,85 inkl. DSL- und ISDN-Grundgebühr!
http://www.arcor.de/rd/emf-dsl-2
next prev parent reply other threads:[~2007-01-25 7:30 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-23 20:48 [Xenomai-help] isolating unwanted mode switch Jeff Weber
2007-01-23 21:45 ` Dmitry Adamushko
2007-01-23 22:27 ` Jeff Weber
2007-01-24 10:08 ` Dmitry Adamushko
2007-01-24 11:22 ` [Xenomai-help] Patching latest Denx 2.4.25-devel kernel with xenomai-2.3.0 fails Daniel Schnell
2007-01-24 14:44 ` Wolfgang Grandegger
2007-01-24 17:04 ` Daniel Schnell
2007-01-24 21:33 ` Wolfgang Grandegger
2007-01-25 7:14 ` Wolfgang Grandegger
2007-01-25 9:03 ` Daniel Schnell
2007-01-25 9:38 ` Wolfgang Grandegger
2007-01-29 15:36 ` Philippe Gerum
2007-01-24 17:52 ` [Xenomai-help] isolating unwanted mode switch Jeff Weber
2007-01-24 18:55 ` Eric Noulard
2007-01-25 7:30 ` M. Koehrer [this message]
2007-01-25 8:24 ` Eric Noulard
2007-01-25 10:50 ` Philippe Gerum
2007-01-25 17:04 ` Jeff Weber
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=4080619.1169710201822.JavaMail.ngmail@domain.hid \
--to=mathias_koehrer@domain.hid \
--cc=eric.noulard@domain.hid \
--cc=jweber@domain.hid \
--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.