From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 720F43858034; Wed, 27 Oct 2021 14:58:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 720F43858034 From: "adhemerval.zanella at linaro dot org" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/15310] _dl_sort_fini is O(n^3) causing slow exit when many dsos Date: Wed, 27 Oct 2021 14:58:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: adhemerval.zanella at linaro dot org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: bug_status cc resolution Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2021 14:58:59 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D15310 Adhemerval Zanella changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |adhemerval.zanella at lina= ro dot o | |rg Resolution|--- |FIXED --- Comment #27 from Adhemerval Zanella --- The testcase which creates a linear chain test to demostrate the O(n^3) behavior shows an improvement with the new DSO sorting algorithm from 15a0c5730d1d5ae: $ time ./testrun.sh /tmp/test/main1000 2>&1 >/dev/null=20 real 0m1.641s user 0m1.565s sys 0m0.076s $ time GLIBC_TUNABLES=3Dglibc.rtld.dynamic_sort=3D2 ./testrun.sh /tmp/test/= main1000 2>&1 >/dev/null=20 real 0m0.316s user 0m0.219s sys 0m0.095s And profile shows similar improvement: $ perf record ./testrun.sh /tmp/test/main1000 [...] $ perf report --stdio -q [...] 78.28% ld-linux-x86-64 ld.so [.] _dl_sort_maps 6.77% ld-linux-x86-64 ld.so [.] do_lookup_x 5.03% ld-linux-x86-64 ld.so [.] memmove 2.64% ld-linux-x86-64 ld.so [.] strcmp $ perf record env GLIBC_TUNABLES=3Dglibc.rtld.dynamic_sort=3D2 ./testrun.sh /tmp/test/main1000 [...] $ perf report --stdio -q --dso=3Dld.so [...] 41.44% ld-linux-x86-64 [.] do_lookup_x 13.76% ld-linux-x86-64 [.] strcmp 6.01% ld-linux-x86-64 [.] _dl_map_object 5.17% ld-linux-x86-64 [.] _dl_name_match_p 1.34% ld-linux-x86-64 [.] _dl_map_object_from_fd 0.69% ld-linux-x86-64 [.] _dl_add_to_namespace_list --=20 You are receiving this mail because: You are on the CC list for the bug.=