From patchwork Tue Mar 16 17:29:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 42609 X-Patchwork-Delegate: azanella@linux.vnet.ibm.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 61E0C386186A; Tue, 16 Mar 2021 17:29:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 61E0C386186A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1615915797; bh=bb4AMpIIHYU4HbK26rS2iBDf77TzAfEs0dn1ij8V2Mg=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=oPC1t2Qk/QHV2jP+S1CQd+570KIOHYYNlo6qYyeUkkxqcb6i8fOMu57SNZkkbcWr1 TMRPyVd3LMTK5eZNI5eFwZbgyx+ETjOUzv1eO/H//5fdOLtLuZT4giE9N+v9RVZGhA UN63abXJYB2sck9vwpMOaTUU8Pm6P3I0ghf+RfeM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id E7F82386185F for ; Tue, 16 Mar 2021 17:29:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E7F82386185F 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-175-uWQg8qIKPF2LSqWN8IYl7w-1; Tue, 16 Mar 2021 13:29:50 -0400 X-MC-Unique: uWQg8qIKPF2LSqWN8IYl7w-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8777B800C78 for ; Tue, 16 Mar 2021 17:29:49 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-254.ams2.redhat.com [10.36.112.254]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB61D5D9D3 for ; Tue, 16 Mar 2021 17:29:48 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH v3 18/37] nptl: Invoke the set_robust_list system call directly in fork In-Reply-To: References: Message-Id: Date: Tue, 16 Mar 2021 18:29:57 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK 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: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This removes one of the pthread forwarder functions. Reviewed-by: Adhemerval Zanella --- nptl/nptl-init.c | 21 --------------------- sysdeps/nptl/fork.c | 11 ++--------- sysdeps/nptl/pthread-functions.h | 1 - 3 files changed, 2 insertions(+), 31 deletions(-) diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c index 49d811aed7..de64e34783 100644 --- a/nptl/nptl-init.c +++ b/nptl/nptl-init.c @@ -60,14 +60,6 @@ int __set_robust_list_avail; /* Version of the library, used in libthread_db to detect mismatches. */ static const char nptl_version[] __attribute_used__ = VERSION; - -#ifdef SHARED -static -#else -extern -#endif -void __nptl_set_robust (struct pthread *); - #ifdef SHARED static const struct pthread_functions pthread_functions = { @@ -92,25 +84,12 @@ static const struct pthread_functions pthread_functions = .ptr___pthread_getspecific = __pthread_getspecific, .ptr___pthread_setspecific = __pthread_setspecific, .ptr__nptl_setxid = __nptl_setxid, - .ptr_set_robust = __nptl_set_robust }; # define ptr_pthread_functions &pthread_functions #else # define ptr_pthread_functions NULL #endif - -#ifdef SHARED -static -#endif -void -__nptl_set_robust (struct pthread *self) -{ - INTERNAL_SYSCALL_CALL (set_robust_list, &self->robust_head, - sizeof (struct robust_list_head)); -} - - /* For asynchronous cancellation we use a signal. This is the handler. */ static void sigcancel_handler (int sig, siginfo_t *si, void *ctx) diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c index ffc8f9d041..a2a0643a1d 100644 --- a/sysdeps/nptl/fork.c +++ b/sysdeps/nptl/fork.c @@ -104,15 +104,8 @@ __libc_fork (void) self->robust_prev = &self->robust_head; #endif self->robust_head.list = &self->robust_head; -#ifdef SHARED - if (__builtin_expect (__libc_pthread_functions_init, 0)) - PTHFCT_CALL (ptr_set_robust, (self)); -#else - extern __typeof (__nptl_set_robust) __nptl_set_robust - __attribute__((weak)); - if (__builtin_expect (__nptl_set_robust != NULL, 0)) - __nptl_set_robust (self); -#endif + INTERNAL_SYSCALL_CALL (set_robust_list, &self->robust_head, + sizeof (struct robust_list_head)); /* Reset the lock state in the multi-threaded case. */ if (multiple_threads) diff --git a/sysdeps/nptl/pthread-functions.h b/sysdeps/nptl/pthread-functions.h index 2092ecef07..844838cd49 100644 --- a/sysdeps/nptl/pthread-functions.h +++ b/sysdeps/nptl/pthread-functions.h @@ -53,7 +53,6 @@ struct pthread_functions void *(*ptr___pthread_getspecific) (pthread_key_t); int (*ptr___pthread_setspecific) (pthread_key_t, const void *); int (*ptr__nptl_setxid) (struct xid_command *); - void (*ptr_set_robust) (struct pthread *); }; /* Variable in libc.so. */