From patchwork Wed Nov 3 16:28:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 47010 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6B613385841B for ; Wed, 3 Nov 2021 16:36:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B613385841B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635957410; bh=BRt+kpx6kFRbxp+d9Wt3AoNroGzM3dA6Ea/+7NIeG2E=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=wDOV8D4ggEBTjYFVxRP+w8lDqBvXf4DoSwQLQbc06NOpN+NSOFutEZBgvo1CQkAXf Xojer/uYMPYtAjJjD4r54eXc49Krb2srdbiX4MUT2k1VCsFBYahoiWbZZLcAi2oJ4A w7bLUUz5dBKl4HcNsWX2rrTotPMN4TkyZxGlSKS8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTPS id E5F0F385841C for ; Wed, 3 Nov 2021 16:28:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E5F0F385841C Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-463-6_ECKDL5NgWyHdHiPsPzlA-1; Wed, 03 Nov 2021 12:28:30 -0400 X-MC-Unique: 6_ECKDL5NgWyHdHiPsPzlA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 756D25074B; Wed, 3 Nov 2021 16:28:29 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 375EA2B060; Wed, 3 Nov 2021 16:28:28 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [PATCH 0/4] Use _dl_find_eh_frame to locate DWARF EH data in the unwinder X-From-Line: adeb300eebaa792d64fca85f1e72fed03c1b32d1 Mon Sep 17 00:00:00 2001 Message-Id: Date: Wed, 03 Nov 2021 17:28:26 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Gcc-patches From: Florian Weimer Reply-To: Florian Weimer Cc: Jakub Jelinek , libc-alpha@sourceware.org Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" This is the GCC side of the patch series. To simplify testing, a weak reference to _dl_find_eh_frame is used to enable this feature when running on newer glibc even if built for older glibc. The first three patches are cleanups/refactorings to simplify the actual change in the last patch. Benchmarking-wise, the new unwinder is slightly faster even in the optimal case for the old implementation (single-threaded, 100% cache hit rate). The old implementation performs really poorly once the cache hit rate drops and the number of shared objects participating in unwinding increases, so that's not a fair comparison. Old performance with multiple threads is also poor due to the global loader lock implied by dl_iterate_phdr (which is necessary to serialize access to the libgcc unwinder cache), and I haven't bother to benchmark that. Thanks, Florian Florian Weimer (4): libgcc: Remove tbase member from struct unw_eh_callback_data libgcc: Remove dbase member from struct unw_eh_callback_data if NULL libgcc: Split FDE search code from PT_GNU_EH_FRAME lookup libgcc: Use _dl_find_eh_frame in _Unwind_Find_FDE libgcc/unwind-dw2-fde-dip.c | 185 +++++++++++++++++++++++++++--------- 1 file changed, 139 insertions(+), 46 deletions(-) base-commit: 6b8b25575570ffde37cc8997af096514b929779d