From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by sourceware.org (Postfix) with ESMTPS id E17A0385781F for ; Thu, 18 Mar 2021 12:54:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E17A0385781F Received: by mail-qk1-x729.google.com with SMTP id l132so1796691qke.7 for ; Thu, 18 Mar 2021 05:54:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Jp2iN2UlHGCzdRKVUzN5ul9CbpumsNtxmqU3EA9i5Wk=; b=Un96okQo8JDCSLmURo8UwTgfmj19JvqnUzfD94RZ4uCktMcJyzSiHCAZYIggxyE/dQ CZ/pW7VgOF984PZPa8kEolJ+4H417sYl+5jjbVPNoNVJ7KPk2+P4F+LmUVpI431CVlH6 /3Hbc5BCWzOWC4qFPOxwveX0HLRCMh6Mws7dRfRS/MO9Q1DkkgmnlbCKdxBj/9hgPVpT i53ZOgz7lDMjdjj3tyRWdLhrb3RYVjF+6DtjM9BmKK7f07a+0Lc18m7SCOe+N4e/lx08 CqTgAS9WnwUMhXsNhk7U5HaWnIfMmxVdCS+TqUoT7qFa8JA4VBlZFCPc/rZivDwgkWFF m8YQ== X-Gm-Message-State: AOAM530cqNilIkxZ24M2MoloJtO+/CgeUwqvZdLAx2fxbxRkiApWY2yU GkyFW6eOwF5E5OccHuN/g71CHQ== X-Google-Smtp-Source: ABdhPJzIqqfJnimkj2j8Y5e9C9o2jEhOApzgbkD0BH9ZvXE3hr0BORxN0VW3W1faIho8R/+BvtlBsQ== X-Received: by 2002:a37:a353:: with SMTP id m80mr4216727qke.14.1616072094415; Thu, 18 Mar 2021 05:54:54 -0700 (PDT) Received: from [192.168.1.4] ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id p8sm1378177qtu.8.2021.03.18.05.54.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Mar 2021 05:54:54 -0700 (PDT) Subject: Re: [PATCH v3 18/37] nptl: Invoke the set_robust_list system call directly in fork To: libc-alpha@sourceware.org, Florian Weimer References: From: Adhemerval Zanella Message-ID: <059ed408-c99e-1d5f-c50f-2fe51bd981de@linaro.org> Date: Thu, 18 Mar 2021 09:54:51 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, 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-List-Received-Date: Thu, 18 Mar 2021 12:54:56 -0000 On 16/03/2021 14:29, Florian Weimer via Libc-alpha wrote: > This removes one of the pthread forwarder functions. LGTM. 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) Ok. > 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) Ok. > 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. */ > Ok.