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 1F2AF3858418 for ; Sat, 29 Apr 2023 14:53:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1F2AF3858418 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 1pslwx-0000JM-MK; Sat, 29 Apr 2023 10:53:23 -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=S/W6EhnzXqMV59qfwZkEw2m0QUhmvM5JNZsoZyMWsoY=; b=B6b1lk8q+LotIAV3mctT 1SAnu+PFpIIHIQmRxrZgImwXzPxwu2IaF4gD6RIXj5iSODPoC2Kleby2yyrDoKphBqMwgJiqD0Zrc cPYuZg40g4LKAiIyJkUTyf/lqjSKiHHoNRL8FMmmHOBs1ou7QpcjgMjYgN7Nf9aWV7CxYeE2U5Omn lnsbsr/ad1bhrhHJ+/DoKGLXFp6MVF5eiUM1RuqYc1PYFdokE/1FDCa9c55PrfD6Fypkmflq+BNiG fo7pas6fwhm0WSYSyQ7smajQZtaHTpbBUJvQ7Y+zKLh0ChalyzbHfJdVpJWe111FaHtrPw08gg45r Fim05nodERFQKA==; Received: from [2a01:cb19:4a:a400: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 1pslwx-0008Be-6d; Sat, 29 Apr 2023 10:53:23 -0400 Received: from samy by begin.home with local (Exim 4.96) (envelope-from ) id 1pslww-002EPZ-0I; Sat, 29 Apr 2023 16:53:22 +0200 Date: Sat, 29 Apr 2023 16:53:22 +0200 From: Samuel Thibault To: Sergey Bugaev Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org Subject: Re: [PATCH 3/7] hurd: Mark various conditions as unlikely Message-ID: <20230429145322.dxo2tebi7cwyel6q@begin> Mail-Followup-To: Sergey Bugaev , libc-alpha@sourceware.org, bug-hurd@gnu.org References: <20230429131354.2507443-1-bugaevc@gmail.com> <20230429131354.2507443-3-bugaevc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230429131354.2507443-3-bugaevc@gmail.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-12.3 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 sam. 29 avril 2023 16:13:50 +0300, a ecrit: > Signed-off-by: Sergey Bugaev > --- > hurd/hurd/fd.h | 10 +++++----- > hurd/hurd/signal.h | 4 ++-- > 2 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/hurd/hurd/fd.h b/hurd/hurd/fd.h > index 241797bf..824b7dbb 100644 > --- a/hurd/hurd/fd.h > +++ b/hurd/hurd/fd.h > @@ -73,18 +73,18 @@ _hurd_fd_get (int fd) > > HURD_CRITICAL_BEGIN; > __mutex_lock (&_hurd_dtable_lock); > - if (fd < 0 || fd >= _hurd_dtablesize) > + if (__glibc_unlikely (fd < 0 || fd >= _hurd_dtablesize)) > descriptor = NULL; > else > { > struct hurd_fd *cell = _hurd_dtable[fd]; > - if (cell == NULL) > + if (__glibc_unlikely (cell == NULL)) > /* No descriptor allocated at this index. */ > descriptor = NULL; > else > { > __spin_lock (&cell->port.lock); > - if (cell->port.port == MACH_PORT_NULL) > + if (__glibc_unlikely (cell->port.port == MACH_PORT_NULL)) > /* The descriptor at this index has no port in it. > This happens if it existed before but was closed. */ > descriptor = NULL; > @@ -107,7 +107,7 @@ _hurd_fd_get (int fd) > > #define HURD_FD_USE(fd, expr) \ > ({ struct hurd_fd *descriptor = _hurd_fd_get (fd); \ > - descriptor == NULL ? EBADF : (expr); }) > + __glibc_unlikely (descriptor == NULL) ? EBADF : (expr); }) > > /* Evaluate EXPR with the variable `port' bound to the port to FD, and > `ctty' bound to the ctty port. */ > @@ -125,7 +125,7 @@ _hurd_fd_get (int fd) > io_t port, ctty; \ > void *crit = _hurd_critical_section_lock (); \ > __spin_lock (&__d->port.lock); \ > - if (__d->port.port == MACH_PORT_NULL) \ > + if (__glibc_unlikely (__d->port.port == MACH_PORT_NULL)) \ > { \ > __spin_unlock (&__d->port.lock); \ > _hurd_critical_section_unlock (crit); \ > diff --git a/hurd/hurd/signal.h b/hurd/hurd/signal.h > index 302ca25e..8a547fd0 100644 > --- a/hurd/hurd/signal.h > +++ b/hurd/hurd/signal.h > @@ -249,9 +249,9 @@ _hurd_critical_section_unlock (void *our_lock) > sigset_t pending; > _hurd_sigstate_lock (ss); > __spin_unlock (&ss->critical_section_lock); > - pending = _hurd_sigstate_pending(ss) & ~ss->blocked; > + pending = _hurd_sigstate_pending (ss) & ~ss->blocked; > _hurd_sigstate_unlock (ss); > - if (! __sigisemptyset (&pending)) > + if (__glibc_unlikely (!__sigisemptyset (&pending))) > /* There are unblocked signals pending, which weren't > delivered because we were in the critical section. > Tell the signal thread to deliver them now. */ > -- > 2.40.1 > -- Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.