From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 2D5233951884 for ; Sun, 9 May 2021 21:42:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2D5233951884 Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-479-kLrDSBq4O6ulBrJoty5spw-1; Sun, 09 May 2021 17:42:40 -0400 X-MC-Unique: kLrDSBq4O6ulBrJoty5spw-1 Received: by mail-qv1-f69.google.com with SMTP id c20-20020a0cf2d40000b02901e8759f1f5eso430000qvm.10 for ; Sun, 09 May 2021 14:42:40 -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:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=nIa2ew+0eHRCxaQQo47Sf+TALn8S6yKJYONfgT04+Ok=; b=P7xon0E1Pnh2xyj/iftTMSIxvEDHJAcifJ/S1K4Wictw7nbW4uPChHbWKLnGQVyGHE usMddy6mCcMjHAZeYOCy8xkcUSnu0tjg6NGYZB90RdVXzDbo71dWQ6akytVU9zoPvqHm YAxFm08UCNkDJxW8PS3+5iRJaoVswaD0LKYn07LIKpbgEM+miR50y/ATDzRzDUT6yjXt bxXtFG9vOsrIkNK66Zo6y9r4vxsZ4+2cO/sXxIPboQTVvgHo4EbxeBoExTJMByNudelG dxV57xj6aD9Vt4LSGM7gKULkPjnfv+2sy0UtykwlTXGNePX34xlLCEorg4ECZMOr0/pH 30Dw== X-Gm-Message-State: AOAM531mWarKnH5kYOEYTy3HsJRLQO+jznz0HurKPru0nY1/hHdkt39l wy3+Pmx9Yyt6VtEl8CmURsIPsn4f+yRhQyXmCkurR/hk4r6GBZurJ2Yy7qcohD3kRBHpJ++mi6r cdpYdBgHBrlxOD/omktSmZuvOmaeWDMu8MaUOuYdLPuYstcNEI+yBIFC3bJQzJqR4/WtJCA== X-Received: by 2002:a05:620a:1230:: with SMTP id v16mr20576299qkj.14.1620596559729; Sun, 09 May 2021 14:42:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmnrq0jp7ce6ceIrNeIES4V72eWyDUbuLDvFa0cMgORjOd2a87cv3a4OJPsA+QUiGxJYl8ug== X-Received: by 2002:a05:620a:1230:: with SMTP id v16mr20576287qkj.14.1620596559493; Sun, 09 May 2021 14:42:39 -0700 (PDT) Received: from [192.168.1.16] (198-84-214-74.cpe.teksavvy.com. [198.84.214.74]) by smtp.gmail.com with ESMTPSA id 123sm3165384qkg.0.2021.05.09.14.42.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 May 2021 14:42:38 -0700 (PDT) Subject: Re: [PATCH 06/13] nptl: Eliminate __pthread_multiple_threads To: Florian Weimer , libc-alpha@sourceware.org References: <831eb2a40a5afc5ed198da0f5252efe9a50d9c2b.1620323953.git.fweimer@redhat.com> From: Carlos O'Donell Organization: Red Hat Message-ID: <1c18151f-30ee-c2d5-898b-12c3aa158c40@redhat.com> Date: Sun, 9 May 2021 17:42:38 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <831eb2a40a5afc5ed198da0f5252efe9a50d9c2b.1620323953.git.fweimer@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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-List-Received-Date: Sun, 09 May 2021 21:42:43 -0000 On 5/6/21 2:10 PM, Florian Weimer via Libc-alpha wrote: > It is no longer needed after the SINGLE_THREADED_P consolidation. Yup. LGTM. Tested on x86_64 and i686 without regression. Tested-by: Carlos O'Donell Reviewed-by: Carlos O'Donell > --- > nptl/allocatestack.c | 4 ++-- > nptl/pthreadP.h | 7 ------- > nptl/pthread_cancel.c | 2 +- > nptl/vars.c | 7 ------- > 4 files changed, 3 insertions(+), 17 deletions(-) > > diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c > index 059786192e..88c49f8154 100644 > --- a/nptl/allocatestack.c > +++ b/nptl/allocatestack.c > @@ -477,7 +477,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, > /* This is at least the second thread. */ > pd->header.multiple_threads = 1; > #ifndef TLS_MULTIPLE_THREADS_IN_TCB > - __pthread_multiple_threads = __libc_multiple_threads = 1; > + __libc_multiple_threads = 1; > #endif > > #ifdef NEED_DL_SYSINFO > @@ -598,7 +598,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, > /* This is at least the second thread. */ > pd->header.multiple_threads = 1; > #ifndef TLS_MULTIPLE_THREADS_IN_TCB > - __pthread_multiple_threads = __libc_multiple_threads = 1; > + __libc_multiple_threads = 1; > #endif > > #ifdef NEED_DL_SYSINFO > diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h > index dd6d6c6342..8ab247f977 100644 > --- a/nptl/pthreadP.h > +++ b/nptl/pthreadP.h > @@ -370,13 +370,6 @@ extern unsigned long int *__fork_generation_pointer attribute_hidden; > /* Register the generation counter in the libpthread with the libc. */ > extern void __libc_pthread_init (void (*reclaim) (void)); > > -#ifndef TLS_MULTIPLE_THREADS_IN_TCB > -/* Variable set to a nonzero value either if more than one thread runs or ran, > - or if a single-threaded process is trying to cancel itself. See > - nptl/descr.h for more context on the single-threaded process case. */ > -extern int __pthread_multiple_threads attribute_hidden; > -#endif > - > extern size_t __pthread_get_minstack (const pthread_attr_t *attr); > > /* Namespace save aliases. */ > diff --git a/nptl/pthread_cancel.c b/nptl/pthread_cancel.c > index 2cab8f0a34..fd04bedf6c 100644 > --- a/nptl/pthread_cancel.c > +++ b/nptl/pthread_cancel.c > @@ -90,7 +90,7 @@ __pthread_cancel (pthread_t th) > points get executed. */ > THREAD_SETMEM (THREAD_SELF, header.multiple_threads, 1); > #ifndef TLS_MULTIPLE_THREADS_IN_TCB > - __pthread_multiple_threads = __libc_multiple_threads = 1; > + __libc_multiple_threads = 1; > #endif > } > /* Mark the thread as canceled. This has to be done > diff --git a/nptl/vars.c b/nptl/vars.c > index 8de30856b8..03a6cc84be 100644 > --- a/nptl/vars.c > +++ b/nptl/vars.c > @@ -26,10 +26,3 @@ union pthread_attr_transparent __default_pthread_attr attribute_hidden; > > /* Mutex protecting __default_pthread_attr. */ > int __default_pthread_attr_lock = LLL_LOCK_INITIALIZER; > - > -#ifndef TLS_MULTIPLE_THREADS_IN_TCB > -/* Variable set to a nonzero value either if more than one thread runs or ran, > - or if a single-threaded process is trying to cancel itself. See > - nptl/descr.h for more context on the single-threaded process case. */ > -int __pthread_multiple_threads attribute_hidden; > -#endif > -- Cheers, Carlos.