From patchwork Fri Apr 16 09:22:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 43001 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 9A4D33955C9A; Fri, 16 Apr 2021 09:22:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A4D33955C9A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1618564933; bh=h8auHiPtz9f5eYW+u0nHrKzNqwK12o6JsJnfx6IN1eU=; 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=N7nTmwhcWdCyUDwde6Pdr7kvVRjgMOxYMM+rVT0nCaFvq9AD4W46mnRgWlPvTeC1n WcSNRjriHF0lYUXT/l8meIGN0Nxc9O+sd17/fN62RFOjt5km/g9vSYfMp/SMN7pRwl /CwtuBRfjS7eErtMMCoXjcn5g2jGmPU9uyPk7keQ= 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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 60B25395541A for ; Fri, 16 Apr 2021 09:22:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 60B25395541A 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-318-CxX7r4FXPyGIbZy42-lbJw-1; Fri, 16 Apr 2021 05:22:05 -0400 X-MC-Unique: CxX7r4FXPyGIbZy42-lbJw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2D0791006C82 for ; Fri, 16 Apr 2021 09:22:05 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-139.ams2.redhat.com [10.36.113.139]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 93AB4669F3 for ; Fri, 16 Apr 2021 09:22:04 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH v4 18/37] nptl: Invoke the set_robust_list system call directly in fork In-Reply-To: References: Message-Id: Date: Fri, 16 Apr 2021 11:22:22 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.6 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_H4, 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 --------------------- nptl/pthreadP.h | 3 --- sysdeps/nptl/fork.c | 11 ++--------- sysdeps/nptl/pthread-functions.h | 1 - 4 files changed, 2 insertions(+), 34 deletions(-) diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c index 41c566c9bd..8f9d41ac62 100644 --- a/nptl/nptl-init.c +++ b/nptl/nptl-init.c @@ -59,14 +59,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 = { @@ -91,25 +83,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/nptl/pthreadP.h b/nptl/pthreadP.h index 5242a2bce6..7a3906e2de 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -692,9 +692,6 @@ libc_hidden_proto (__nptl_deallocate_tsd) extern void __nptl_setxid_error (struct xid_command *cmdp, int error) attribute_hidden; extern int __nptl_setxid (struct xid_command *cmdp) attribute_hidden; -#ifndef SHARED -extern void __nptl_set_robust (struct pthread *self); -#endif extern void __nptl_stacks_freeres (void) attribute_hidden; diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c index ccdda11a7c..f41c40fca0 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. */