From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id A8DCE3856DF5 for ; Mon, 17 Apr 2023 23:24:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A8DCE3856DF5 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poYCn-0007bP-9b; Mon, 17 Apr 2023 19:24:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=In-Reply-To:MIME-Version:References:Subject:To:From: Date; bh=xQrF9fy22yzleg4tQZrcGFtINVpcn/9qTFMknfeDkTk=; b=JEdmRkeA+oJYyiLIPHu0 xzlH27gxUQwTwuFmjvgsUnBaee9mdmsyG2iLdl8qBrQkYU4O8EPlk7BEfacV93x33iBqn5qZk0cTm KO+7sd3sRCyyaSF6VbeBKlpPdgTeGVNV9GjZNQKcomVwUAojQdxKB42b3T8VebCGeNgP1XRt0PQx4 X71WjeP3HgFoNKWJxtl45wFU1PO9HRNcBjNqOrZQwo6ZjUnNIvGT9OecdYO3jsn7b8aOMg1k+bqsq M3ZgtD67l9eLahroNw02egDW/5c2aoUeDokEU70KKJfVyUlQ8F5h51ccH/au83DbNH3KodS7g6kJ2 NOWyuurltHGztw==; Received: from 2a01cb008c251f00de41a9fffe47ec49.ipv6.abo.wanadoo.fr ([2a01:cb00:8c25:1f00:de41:a9ff:fe47:ec49] helo=begin.home) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poYCn-00061o-0W; Mon, 17 Apr 2023 19:24:17 -0400 Received: from samy by begin.home with local (Exim 4.96) (envelope-from ) id 1poYCl-00AhFb-35; Tue, 18 Apr 2023 01:24:15 +0200 Date: Tue, 18 Apr 2023 01:24:15 +0200 From: Samuel Thibault To: Sergey Bugaev Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org Subject: Re: [PATCH 4/5] hurd: Simplify _S_catch_exception_raise Message-ID: <20230417232415.cz2ztbmtmlwuuwm4@begin> Mail-Followup-To: Sergey Bugaev , libc-alpha@sourceware.org, bug-hurd@gnu.org References: <20230414193700.542116-1-bugaevc@gmail.com> <20230414193700.542116-4-bugaevc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230414193700.542116-4-bugaevc@gmail.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: Applied, thanks! Sergey Bugaev, le ven. 14 avril 2023 22:36:59 +0300, a ecrit: > _hurd_thread_sigstate () already handles finding an existing sigstate > before allocating a new one, so just use that. Bonus: this will only > lock the _hurd_siglock once. > > Signed-off-by: Sergey Bugaev > --- > hurd/catch-exc.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/hurd/catch-exc.c b/hurd/catch-exc.c > index 5ee2233a..d375bf67 100644 > --- a/hurd/catch-exc.c > +++ b/hurd/catch-exc.c > @@ -58,13 +58,7 @@ _S_catch_exception_raise (mach_port_t port, > _hurd_exception2signal (&d, &signo); > > /* Find the sigstate structure for the faulting thread. */ > - __mutex_lock (&_hurd_siglock); > - for (ss = _hurd_sigstates; ss != NULL; ss = ss->next) > - if (ss->thread == thread) > - break; > - __mutex_unlock (&_hurd_siglock); > - if (ss == NULL) > - ss = _hurd_thread_sigstate (thread); /* Allocate a fresh one. */ > + ss = _hurd_thread_sigstate (thread); > > if (__spin_lock_locked (&ss->lock)) > { > -- > 2.39.2 > -- Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.