From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 7A9B93857C79 for ; Sun, 26 Jul 2020 10:41:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7A9B93857C79 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=mentor.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ChungLin_Tang@mentor.com IronPort-SDR: RmSCnMc74O6ehCqPHUn7vXd4K0a0pgIEY+qroiKp22w9zrfK35V3mPmgll/3SdN1V0l8F4YbRl 0CWPxUcF1VBiBqw0OzJDm+p6MX8D8QLO5Pq8ypPNajS0TzGtcult2p/WLfpQIAUX3yh+yctbJ7 4VgVz/pqbB/sMw//pnzPg9YgZ4xKXHSIHT0HCCX8eGW1jaRHdMYkgr3mQ3/gaN+Ec1wV4K7T/M /lHMS6NYEhX7Fsa1Tu2I4Si19/UqX5SsQ1MIyRGI0deKUt/2YnMAYnk7KEPRu/tawXnuXJwbjL gjk= X-IronPort-AV: E=Sophos;i="5.75,398,1589270400"; d="scan'208";a="51309393" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 26 Jul 2020 02:41:21 -0800 IronPort-SDR: eh0QM4JS7B9o75Pt5nkY6Wm8Mn1zppGNqMzd+pJtKLyN/fduwOhH+/jU5rhcgFdMH7JVp22Hu5 WVBbIYdy+opkVo+B65EnkGya+p6D4FaCXjXMz/+Lt3sXQqtEqzfyVaa2+HhCKL/A9oTxLVo/dG vF9GTm7j60Biymw07OE/CHMhNXuN7Zq5DSdmaI7mmX2ZNKp283IcXiSQS0WWMpttoExWqiZtOF Lw8CkRqcYP3S+zweTvu0FJyvXrW+KlNkF0fIt/saX/1CDcaUeEKkpavHC/HY2EwKWKS7F3uGwO pn8= Reply-To: Subject: Re: [PATCH] elf: Sort only uninitialized objects in _dl_map_object_deps() To: Carlos O'Donell , Xiaoming Ni , , , , , CC: References: <20200725105205.103328-1-nixiaoming@huawei.com> <8a15102b-c461-23e2-21d4-f2f7b2b78682@redhat.com> From: Chung-Lin Tang Message-ID: Date: Sun, 26 Jul 2020 18:41:02 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <8a15102b-c461-23e2-21d4-f2f7b2b78682@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SVR-ORW-MBX-05.mgc.mentorg.com (147.34.90.205) To svr-orw-mbx-02.mgc.mentorg.com (147.34.90.202) X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_MANYTO, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 10:41:25 -0000 On 2020/7/26 4:57 AM, Carlos O'Donell via Libc-alpha wrote: >> Run the dlopen() for each dynamic library. >> Before the patch is installed, it takes 214 seconds. >> After patching, it takes 37 seconds. > Is it still correct? > > Do you have a test case you can add? > >> Signed-off-by: Xiaoming Ni > Reviewing this will have to wait until after the release, but this patch is > interesting. This patch appears to add a linear pass to somewhat reduce the input size of a circularly linked case, but frankly speaking, is only useful with the current old sorting algorithm, and just to a certain degree. The mentioned test case still takes 37 seconds with the proposed patch, while for the new DFS-based algorithm, even without any such special case input reduction, the sort time will probably be instantaneous. > Have you looked at Chung-Ling Tang's most recent work in this area? > > https://patchwork.sourceware.org/project/glibc/patch/1427b370-7400-afd0-16e8-55c1072db20e@mentor.com/ > https://patchwork.sourceware.org/project/glibc/patch/5de3ab61-3dca-b400-15c6-92ff5ae80877@mentor.com/ If you're trying out the #17645 sorting patch, remember to add GLIBC_TUNABLES=glibc.rtld.dynamic_sort=2 to the environment before running the test, or it will still be the old algorithm. > Could you use Chung-Ling's test case constructor to write a test case? > Yeah, a new test case like this is always nice, especially to test if the description language is expressive enough to handle this. Chung-Lin