From patchwork Thu May 27 20:44:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 43618 X-Patchwork-Delegate: fweimer@redhat.com 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 34684395C834; Thu, 27 May 2021 20:45:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 34684395C834 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1622148307; bh=gIDGAM39kO8MfzBMuun6BaGU08y/DjIsaOUx+bVj66A=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=gopaB23YUA/hP6V0rXpIwkjn7PI7c0Ea//OiWRBFSAtjnzyqlnW7zlc1RmQCWXtg7 PA0a57AhUTyD0+mhHDHryyPNw1MQDnOqY93DUnICoXElHK70NMS4PD2MCzT/rM7gkH iH8GQNFEoSrhJ9lFkexcxVKZeUeA4gtAhks5r3lA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by sourceware.org (Postfix) with ESMTPS id 922C9395BC29 for ; Thu, 27 May 2021 20:45:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 922C9395BC29 Received: by mail-qv1-xf33.google.com with SMTP id k2so833986qvc.5 for ; Thu, 27 May 2021 13:45:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gIDGAM39kO8MfzBMuun6BaGU08y/DjIsaOUx+bVj66A=; b=tJjpoE6FZ9lcRfYZcUMKsWVKJdfM8VBwLwXcTySJZ1cvOKrMYVzZumoHWztWS4f/4S 1TuFjg8drhfz7gFysAjpCtN8ukKrM4M+seQ9FA9reaJz7WtDM4epOkas4DmZeZJwr9I/ naKqdfeWaz9nYMPMkwNFraDW47TCXB0nmN9GtuqViLipAGlQa0iFQ6UaTFA+epA3jMjk 76F6Fz967VHUwM1sG+SWAyIZq4Rpx+HX4wYl/QOhYchbXuXEZWoRKiRobfdjjDq8wep2 N0impJHOtRmppVj6ILxFtBn8e+80j3j9LyiYRICfaj9LkexaUtzPa4BTARS+IfIbGPxw I+Ew== X-Gm-Message-State: AOAM531KFPMxbml/oVa9bMpmmufSkOgbyarfKdpyoy7D0/mNX7rUdbqV NIeGkKzoL4XlBrJC2s9jzZFPAmy+LsU03Q== X-Google-Smtp-Source: ABdhPJwQlLA970o8VwqfqhDCrB4q5h8nUVx87tJOOVMrjMjgWQ0C3EGV2SnsDFbCWEeO727MMCSaqg== X-Received: by 2002:a05:6214:766:: with SMTP id f6mr446989qvz.17.1622148303050; Thu, 27 May 2021 13:45:03 -0700 (PDT) Received: from birita.. ([177.194.37.86]) by smtp.googlemail.com with ESMTPSA id e14sm2058385qkl.1.2021.05.27.13.45.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 May 2021 13:45:02 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 1/4] libio: Assume _IO_lock_inexpensive Date: Thu, 27 May 2021 17:44:54 -0300 Message-Id: <20210527204457.1250196-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210527204457.1250196-1-adhemerval.zanella@linaro.org> References: <20210527204457.1250196-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It is already set by both Linux and Hurd. --- libio/libio.h | 11 ++--------- sysdeps/mach/libc-lock.h | 3 --- sysdeps/nptl/stdio-lock.h | 3 --- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/libio/libio.h b/libio/libio.h index 511b39457f..be2cde61e2 100644 --- a/libio/libio.h +++ b/libio/libio.h @@ -282,17 +282,10 @@ libc_hidden_proto (_IO_sgetn) # undef _IO_ftrylockfile # define _IO_peekc(_fp) _IO_peekc_locked (_fp) -# if _IO_lock_inexpensive -# define _IO_flockfile(_fp) \ +# define _IO_flockfile(_fp) \ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_lock_lock (*(_fp)->_lock) -# define _IO_funlockfile(_fp) \ +# define _IO_funlockfile(_fp) \ if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_lock_unlock (*(_fp)->_lock) -# else -# define _IO_flockfile(_fp) \ - if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_flockfile (_fp) -# define _IO_funlockfile(_fp) \ - if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_funlockfile (_fp) -# endif #endif /* _IO_MTSAFE_IO */ #endif /* _LIBIO_H */ diff --git a/sysdeps/mach/libc-lock.h b/sysdeps/mach/libc-lock.h index d713f34b5f..220fcee921 100644 --- a/sysdeps/mach/libc-lock.h +++ b/sysdeps/mach/libc-lock.h @@ -24,9 +24,6 @@ #include #include -/* The locking here is very inexpensive, even for inlining. */ -#define _IO_lock_inexpensive 1 - typedef unsigned int __libc_lock_t; typedef struct { diff --git a/sysdeps/nptl/stdio-lock.h b/sysdeps/nptl/stdio-lock.h index f2eee49816..a4f419b516 100644 --- a/sysdeps/nptl/stdio-lock.h +++ b/sysdeps/nptl/stdio-lock.h @@ -23,9 +23,6 @@ #include -/* The locking here is very inexpensive, even for inlining. */ -#define _IO_lock_inexpensive 1 - typedef struct { int lock; int cnt; void *owner; } _IO_lock_t; #define _IO_lock_t_defined 1