From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 5134F3858D20 for ; Tue, 22 Nov 2022 08:20:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5134F3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669105256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EMhy6YizB1TvWoOYJvxb2DDTjrMsu19q/AcmIOVXZGg=; b=PuPMpLyssRcHehPqubWk2OdzyUr+RFIK4hOZ/vAfh7BFeEkGBWnMC934AnMlYnfnxZPiy2 MiQRIcSt7S0O1Chekobc9HmtSZH1bG39TZ3R/xmMNijlFnmTEpyeOzq0TLezi9X6UatQae HcR7cMgTYBO36jw+tYAMth4mS+qrrsM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-425-NZDgxGG-NDS7Tm6osw9cwQ-1; Tue, 22 Nov 2022 03:20:53 -0500 X-MC-Unique: NZDgxGG-NDS7Tm6osw9cwQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A3458811E67; Tue, 22 Nov 2022 08:20:52 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7868940C6FA0; Tue, 22 Nov 2022 08:20:51 +0000 (UTC) From: Florian Weimer To: Thomas Neumann Cc: "H.J. Lu" , Jakub Jelinek , Tamar Christina , "gcc-patches@gcc.gnu.org" , Jason Merrill , Jonathan Wakely Subject: Re: [PATCH v4] eliminate mutex in fast path of __register_frame References: <2a4776b9-9271-bb3c-a626-d5ec22dae6f3@in.tum.de> <91045a34-a534-4436-bb06-cac32d797a36@in.tum.de> Date: Tue, 22 Nov 2022 09:20:47 +0100 In-Reply-To: <91045a34-a534-4436-bb06-cac32d797a36@in.tum.de> (Thomas Neumann's message of "Tue, 22 Nov 2022 01:31:02 +0100") Message-ID: <87sfibqu1s.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Thomas Neumann: > Hi, > >>>>> When dynamically linking a fast enough machine hides the latency, but when >>>>> Statically linking or on slower devices this change caused a 5x increase in >>>>> Instruction count and 2x increase in cycle count before getting to main. > > I have looked at ways to fix that. The problem is that with static > linking unwinding tables are registered dynamically, and with my patch > that registration triggers an eager sort of fde lists. While > previously the lists were sorted when the first exception was > thrown. If an application throws at least one exception there is no > downside in eager sorting, but if the application never throws there > is overhead. Would it be possible to trigger lazy registration if the version is read as a zero? This would not introduce any additional atomic instructions on the fast path. Thanks, Florian