mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Andy Lutomirski <luto@kernel.org>
Cc: musl@lists.openwall.com
Subject: Re: Re: Further dynamic linker optimizations
Date: Wed, 5 Aug 2015 23:04:48 -0400	[thread overview]
Message-ID: <20150806030448.GC14639@brightrain.aerifal.cx> (raw)
In-Reply-To: <55C29025.8070507@kernel.org>

On Wed, Aug 05, 2015 at 03:37:25PM -0700, Andy Lutomirski wrote:
> >>>>- The whole outer for loop in find_sym is the hot path for
> >>>>   performance. As such, eliminating the lazy calculation of
> >>>>gnu_hash and simply doing it before the loop should be a
> >>>>measurable win, just by removing the if (!ghm) branch.
> >>>
> >>>On a related note, it's possible to avoid calculating sysv hash, if
> >>>gnu-hash is enabled system-wide, by not setting 'global' flag on
> >>>the vdso item (as mentioned on IRC in your conversation with Timo).
> >>
> >>Yes, and I think this sounds like a worthwhile approach. Seeing
> >>timings for it would be great. :-)
> >
> >I told them earlier in IRC. But on the same i7 box and running "clang
> >--version" which has 100+ DT_NEEDED... removing vdso and thus sysv
> >hashing had magnitude of tens of milliseconds. (I wonder how it'd
> >perform if we calculated both sysv and gnu hashes at same time.)
> 
> /me dons vdso maintainer hat.
> 
> I can add a GNU hash to the vdso quite easily (for Linux 4.3).
> Would that be helpful?

Yes, and I'd lean towards doing this unless you can see any
disadvantages to weigh it against (using more pages? would that
matter?). But either way I think we should make the change on the musl
side too. It doesn't make sense for the vdso to appear in the global
namespace unless it was actually pulled in by dlopen/RTLD_GLOBAL. For
actually using the vdso symbols, we don't use the dynamic linker
anyway; we look them up directly so that they work with static linking
(and because the way the dynamic linker/libc is linked precludes vdso
symbols getting used to resolve its own references, anyway).

Rich


  reply	other threads:[~2015-08-06  3:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30 20:04 Rich Felker
2015-07-01  5:41 ` Timo Teras
2015-07-01 14:03   ` Rich Felker
2015-07-01 14:10     ` Timo Teras
2015-07-07 18:39 ` Alexander Monakov
2015-07-07 18:55   ` Rich Felker
2015-07-08  5:48     ` Timo Teras
2015-08-05 22:37       ` Andy Lutomirski
2015-08-06  3:04         ` Rich Felker [this message]
2015-08-06  4:32         ` Isaac Dunham
2015-08-06  9:33           ` Szabolcs Nagy
2015-08-06 15:13             ` Andy Lutomirski

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=20150806030448.GC14639@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=luto@kernel.org \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).