From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id B0B533858D20 for ; Fri, 31 Mar 2023 07:14:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B0B533858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=deneb.enyo.de Received: from [172.17.203.2] (port=35039 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1pi8xx-00GH1p-Qq; Fri, 31 Mar 2023 07:14:29 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.96) (envelope-from ) id 1pi8xx-003hl6-2H; Fri, 31 Mar 2023 09:14:29 +0200 From: Florian Weimer To: John David Anglin Cc: Sam James , John David Anglin , deller@gmx.de, libc-alpha@sourceware.org Subject: Re: [committed] hppa: Drop 16-byte pthread lock alignment References: <87sfdrvxry.fsf@mid.deneb.enyo.de> <87zg7zc9km.fsf@gentoo.org> <20cc14ed-d49d-d655-b866-f8f9bb49e0eb@bell.net> <87ilemwek0.fsf@mid.deneb.enyo.de> Date: Fri, 31 Mar 2023 09:14:29 +0200 In-Reply-To: (John David Anglin's message of "Thu, 30 Mar 2023 17:08:34 -0400") Message-ID: <87lejdqtnu.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * John David Anglin: > On 2023-03-27 8:42 a.m., Florian Weimer wrote: >>> Here is comment in map.h: >>> =A0 // MapAllocator does not support alignments beyond 8. Technically= we should >>> =A0 // support up to std::max_align_t, but this fails with ubsan and = tcmalloc >>> =A0 // debug allocation logic which assume 8 as default alignment. >>> =A0 static_assert(alignof(value_type) <=3D 8, ""); >>> >>> It was the above comment that convinced me that we needed to change >>> the pthread lock alignment. >> It seems that current tcmalloc honors GCC's >> __STDCPP_DEFAULT_NEW_ALIGNMENT__: >> >> > Agreed. > > The current tcmalloc is compiled with c++17.=A0 For earlier versions of c= ++, we have the > following issue: > https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0035r4.html > > There are many packages in Debian and gentoo that are built with > earlier versions of c++ and I don't see that changing.=A0 This > includes protobuf.=A0 Well, GCC nowadays defaults to C++17: $ echo __cplusplus | gcc -x c++ -E - # 0 "" # 0 "" # 0 "" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 0 "" 2 # 1 "" 201703L This is GCC 12 from Debian bookworm. >> On panama.debian.net, it seems correct: >> >> $ gcc -x c++ -E - < /dev/null -dM | grep __STDCPP_DEFAULT_NEW_ALIGNMENT__ >> #define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16 > That should change to 8 to minimize wasted bytes.=A0 The current > pthread types do not need 16-byte alignment. There might be other reasons why 16-byte alignment is needed. But perhaps not on HPPA.