From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc36.google.com (mail-oo1-xc36.google.com [IPv6:2607:f8b0:4864:20::c36]) by sourceware.org (Postfix) with ESMTPS id 4D4143858292 for ; Wed, 22 Jun 2022 12:24:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4D4143858292 Received: by mail-oo1-xc36.google.com with SMTP id s1-20020a4adb81000000b00422e6bf0e92so1245802oou.13 for ; Wed, 22 Jun 2022 05:24:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=zJ/RjNfvt3V4taOLDRLkfJpBNlOW04yfyVXGwJ3a2ts=; b=qrg5RPiCeNrDkznkIAbWa/N+zQ4xnwaRQuVF3xchR7xqfX8AIZ9FzctyQHwb7jTGN3 /kRv+0ImYVIu6lu1NjG0OF5z9jnWnr8QU3XCOJGFxrM7EGTSU1eCchUhLRLpdbZL5GF8 /Q3/uG53krASd6ia37es+Axmfl2QSzMQRQrLnjYZ6wivtc/oxJwqzIRJdpn2rT748cEa levjmKRXuEqbVpXQIEMfVqBfabe1pe1mpqslp3dOu6O6//xouDyOpxkgY85AEbg0KEE7 0aGi//6eu5yXYlQmfjXPREDDcrBdrFoAJyAtSYKuXhd+MO1jdyLpjwK7rGGQeCZoMQ/A kepQ== X-Gm-Message-State: AJIora9CdcbUWt5EnpcBeLzdFhqM3Ews3put+pwVtVhtyM2Zj1P8cU/d +IE9hDx5WmmqydY7HlQGNPf4Xg== X-Google-Smtp-Source: AGRyM1ui71iz70k3nP51g7M0pmhYMbJmUQyFwfIoC1LMj13hREqFb/wW+ldVlT5CewWGc8L2fIaCSw== X-Received: by 2002:a4a:1746:0:b0:41e:982a:1e24 with SMTP id 67-20020a4a1746000000b0041e982a1e24mr1239929ooe.89.1655900697558; Wed, 22 Jun 2022 05:24:57 -0700 (PDT) Received: from smtpclient.apple ([2804:431:c7ca:6d95:c8b8:d3db:a84b:32db]) by smtp.gmail.com with ESMTPSA id i3-20020a056870864300b000f333ac991fsm10553904oal.27.2022.06.22.05.24.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2022 05:24:57 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Subject: Re: [PATCH v3 2/4] Replace __libc_multiple_threads with __libc_single_threaded From: Adhemerval Zanella In-Reply-To: Date: Wed, 22 Jun 2022 09:24:54 -0300 Cc: GNU C Library , Wilco Dijkstra , Fangrui Song Content-Transfer-Encoding: quoted-printable Message-Id: <7FBD1EE7-DCB3-4CFA-8A5C-513837A33EC0@linaro.org> References: <20220621203225.714328-1-adhemerval.zanella@linaro.org> <20220621203225.714328-3-adhemerval.zanella@linaro.org> To: Yann Droneaud X-Mailer: Apple Mail (2.3696.100.31) 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, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Wed, 22 Jun 2022 12:24:59 -0000 > On 22 Jun 2022, at 08:04, Yann Droneaud wrote: >=20 >> diff --git a/sysdeps/unix/sysv/linux/single-thread.h = b/sysdeps/unix/sysv/linux/single-thread.h >> index 4529a906d2..30dde4e81a 100644 >> --- a/sysdeps/unix/sysv/linux/single-thread.h >> +++ b/sysdeps/unix/sysv/linux/single-thread.h >> @@ -19,6 +19,10 @@ >> #ifndef _SINGLE_THREAD_H >> #define _SINGLE_THREAD_H >> +#ifndef __ASSEMBLER__ >> +# include >> +#endif >> + >> /* The default way to check if the process is single thread is by = using the >> pthread_t 'multiple_threads' field. However, for some architectures = it is >> faster to either use an extra field on TCB or global variables (the = TCB >> @@ -27,16 +31,11 @@ >> The ABI might define SINGLE_THREAD_BY_GLOBAL to enable the single = thread >> check to use global variables instead of the pthread_t field. */ >> -#ifndef __ASSEMBLER__ >> -extern int __libc_multiple_threads; >> -libc_hidden_proto (__libc_multiple_threads) >> -#endif >> - >> #if !defined SINGLE_THREAD_BY_GLOBAL || IS_IN (rtld) >=20 > SINGLE_THREAD_BY_GLOBAL doesn't seem to be defined after this patch, = so can it this be updated as: It is moved from sysdep.h to each arch-specific single-thread.h header, so it is really used for this patch. The third patch refactor the SINGLE_THREAD_P macro to remove the SINGLE_THREAD_BY_GLOBAL and the forth patch finally remove all its definition.