From: Philippe Gerum <rpm@xenomai.org>
To: Jeff Weber <jwamsc@domain.hid>
Cc: Xenomai Help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] dynamic loader latencies
Date: Mon, 29 Aug 2011 22:32:45 +0200 [thread overview]
Message-ID: <1314649965.10447.26.camel@domain.hid> (raw)
In-Reply-To: <CAAvA3H_9MbPT+QLgbmVAk-5ZzE2eu0TQo3rzS1mkBV0RtSPcXw@domain.hid>
On Fri, 2011-08-26 at 11:34 -0500, Jeff Weber wrote:
> The Linux ELF dynamic linker/loader ld-linux.so uses a "lazy" model by
> default, and defers symbol resolution, shared object resolution to the
> time when the symbol is first referenced. This sounds like a large
> latency threat to dynamically linked RT applications running in
> primary mode. Can this happen, or is this unlikely?
Good question, I never actually measured this over an application
mapping shared libs which would consist of a large number of routines
called over time.
I would tend to think that ld.so's symbol lookup routine might represent
the highest risk for significant latency, if any, because all the rest,
i.e. GOT, PLT and the code itself should have been read in and processed
at program init, either by ld.so or as a result of mlocking the program.
Running the trampoline code from the PLT and fixing up the GOT with the
indirect jump address after symbol resolution should not entail
significant latency either, so the real issue, if any, might be
introduced by the lookup code actually resolving the symbols. I would
think that all the data is already there, available to ld.so for this
operation, and the ELF format mandates that dynamic symbol names be
hashed for fast retrieval. However, I may be wrong, this needs to be
verified.
>
>
> If this is a latency risk, the only solutions I know of are:
>
>
> 1) Statically link all RT applications
>
>
> 2) Invoke all dynamically linked applications with LD_BIND_NOW=1
> environment to force the dynamic loader to resolve all symbols at
> program startup
>
>
> 3) Link dynamic applications with "-z now" GNU ld option to effect
> same as 2) above.
>
>
> Comments?
>
In short, my understanding is that we should not see significant extra
latency, unless ld.so does on demand loading of portions of the ELF
tables/sections it needs for symbol resolution, instead of loading these
tables at program init. This seems unlikely though.
>
> thanks,
> Jeff
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
--
Philippe.
prev parent reply other threads:[~2011-08-29 20:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-26 16:34 [Xenomai-help] dynamic loader latencies Jeff Weber
2011-08-29 13:26 ` [Xenomai-help] Fwd: " Jeff Weber
2011-08-29 13:49 ` Gilles Chanteperdrix
2011-08-29 20:32 ` 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=1314649965.10447.26.camel@domain.hid \
--to=rpm@xenomai.org \
--cc=jwamsc@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.