public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug dynamic-link/17645] New: RFE: Improve performance of dynamic loader for deeply nested DSO dependencies.
@ 2014-11-25 13:37 paulo.cesar.pereira.de.andrade at gmail dot com
  2014-11-25 13:52 ` [Bug dynamic-link/17645] " paulo.cesar.pereira.de.andrade at gmail dot com
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: paulo.cesar.pereira.de.andrade at gmail dot com @ 2014-11-25 13:37 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17645

            Bug ID: 17645
           Summary: RFE: Improve performance of dynamic loader for deeply
                    nested DSO dependencies.
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: paulo.cesar.pereira.de.andrade at gmail dot com

Created attachment 7970
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7970&action=edit
Sample "redistributable" test case provided by a customer

After glibc-2.11, there are 3 slightly different instances
of a very CPU intensive loop in elf/dl-deps.c, elf/dl-fini.c
and elf/dl-open.c. The loop does not scale well when there
are cyclic dependencies, and may take more than 8 seconds
to sort less than 300 shared objects when there a some
cycles. Most of the time is spent in memmove.

Sample perf output of it taking 8+ secs on a core i5:

 31,24%  timedlopen  ld-2.17.so         [.] _dl_map_object_deps
 18,36%  timedlopen  ld-2.17.so         [.] _wordcopy_fwd_aligned
 16,50%  timedlopen  ld-2.17.so         [.] _dl_sort_fini
 15,47%  timedlopen  ld-2.17.so         [.] dl_open_worker
 13,08%  timedlopen  ld-2.17.so         [.] _wordcopy_fwd_dest_aligned
  4,95%  timedlopen  ld-2.17.so         [.] memmove
  0,07%  timedlopen  ld-2.17.so         [.] do_lookup_x

I have been using a patch for some weeks in rhel-6.3
(for basic tests where the problem was detected/reported),
and my day to day computers, running rhel-7 and fedora
rawhide, and cannot see any problems running kde, gnome,
libreoffice and several other large applications or
environments that load/unload or have large dso dependency
chains.

The proposed patch runs the test case in 10 ms, and a
sample perf output is:

 17,45%  timedlopen  ld-2.17.so         [.] do_lookup_x
  9,54%  timedlopen  ld-2.17.so         [.] strcmp
  6,91%  timedlopen  ld-2.17.so         [.] _dl_map_object_deps
  6,12%  timedlopen  ld-2.17.so         [.] _dl_name_match_p
  4,35%  timedlopen  ld-2.17.so         [.] _dl_sort_fini
  4,33%  timedlopen  ld-2.17.so         [.] dl_open_worker

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-11-24  7:24 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-25 13:37 [Bug dynamic-link/17645] New: RFE: Improve performance of dynamic loader for deeply nested DSO dependencies paulo.cesar.pereira.de.andrade at gmail dot com
2014-11-25 13:52 ` [Bug dynamic-link/17645] " paulo.cesar.pereira.de.andrade at gmail dot com
2014-11-25 14:10 ` paulo.cesar.pereira.de.andrade at gmail dot com
2014-11-25 14:37 ` paulo.cesar.pereira.de.andrade at gmail dot com
2014-11-26 16:41 ` carlos at redhat dot com
2014-11-26 21:56 ` paulo.cesar.pereira.de.andrade at gmail dot com
2014-11-28 15:51 ` carlos at redhat dot com
2014-11-29 22:30 ` paulo.cesar.pereira.de.andrade at gmail dot com
2015-03-17 22:50 ` paulo.cesar.pereira.de.andrade at gmail dot com
2015-03-18 17:21 ` paulo.cesar.pereira.de.andrade at gmail dot com
2015-03-18 17:26 ` paulo.cesar.pereira.de.andrade at gmail dot com
2020-05-06 16:30 ` romain.geissler at amadeus dot com
2020-05-06 16:54 ` carlos at redhat dot com
2020-07-03 16:18 ` carlos at redhat dot com
2020-07-03 16:18 ` carlos at redhat dot com
2020-07-21 14:48 ` s at martinien dot de
2020-12-27 18:31 ` romain.geissler at amadeus dot com
2020-12-27 18:33 ` romain.geissler at amadeus dot com
2021-03-03 22:29 ` san+sourceware at smederijmerlijn dot nl
2021-04-01 21:16 ` hi-angel at yandex dot ru
2021-07-06 11:08 ` marat at slonopotamus dot org
2021-08-10 13:03 ` romain.geissler at amadeus dot com
2021-10-21 19:21 ` cvs-commit at gcc dot gnu.org
2021-10-21 19:23 ` adhemerval.zanella at linaro dot org
2023-11-24  7:24 ` fweimer at redhat dot com

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 read-only IMAP folder(s) and NNTP newsgroup(s).