From: Philippe Gerum <philippe.gerum@domain.hid>
To: "M. Koehrer" <mathias_koehrer@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Dynamic load of shared object files in real time applications
Date: Thu, 11 Jan 2007 20:17:53 +0100 [thread overview]
Message-ID: <1168543073.25399.154.camel@domain.hid> (raw)
In-Reply-To: <10623239.1168007940021.JavaMail.ngmail@domain.hid>
On Fri, 2007-01-05 at 15:39 +0100, M. Koehrer wrote:
> Hi everybody,
>
> I have a question that is similar to the one concerning the system() call out of
> a real time context.
> I want to create a flexible framework that allows dynamic loading of shared objects
> during runtime. (The loading itself can of course not work in real time).
> The main application itself should run for a very long time (a couple of days)
> and during that long run time I want to load and unload small pieces of code that
> have to be executed.
> After loading a .so file I want to hook loaded routines into the (already existing) real time context
> of my main application.
> Is it possible that this kind of operation can cause any memory issue similar to that
> I detected in the 2.6.19 kernel (the system() call out of a real time context)?
> I ask as the dlopen() call probably extends the valid address range of the current
> process.
>
The initial VM_NOCOW patch only affects the mm copy code on the process
fork path, not the mmap code. And shared libs do depend on COW, for
relocation fixups and other issues. In short, I don't think dynamic
binding would be safe wrt COW handling using this patch.
However, the recent VM_NOFAULT patch Gilles has just posted to the -core
mailing list should solve the issue: the point is to have COW pages
excluded from all VMAs mapped by a (real-time) task, and this is what
ipipe_disable_task_faults() does among other things.
You might also want to try telling the dynamic linker to resolve all
symbols from your shared libs at startup using the LD_BIND_NOW boolean
variable; maybe this would prevent further fixups involving COW
breakage. Static storage data defined by the library that might need to
break COW and as such generate a fault are another issue though.
> Thanks for any feedback on that question.
>
> Regards
>
> Mathias
>
>
>
--
Philippe.
prev parent reply other threads:[~2007-01-11 19:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-05 14:39 [Xenomai-help] Dynamic load of shared object files in real time applications M. Koehrer
2007-01-11 19:17 ` Philippe Gerum [this message]
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=1168543073.25399.154.camel@domain.hid \
--to=philippe.gerum@domain.hid \
--cc=mathias_koehrer@domain.hid \
--cc=rpm@xenomai.org \
--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.