From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cmx-mtlrgo001.bell.net (mta-mtl-001.bell.net [209.71.208.11]) by sourceware.org (Postfix) with ESMTP id AB53C3858439 for ; Thu, 30 Mar 2023 21:08:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AB53C3858439 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bell.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bell.net X-RG-CM-BuS: 0 X-RG-CM-SC: 0 X-RG-CM: Clean X-Originating-IP: [174.95.58.126] X-RG-Env-Sender: dave.anglin@bell.net X-RG-Rigid: 642328290045CC57 X-CM-Envelope: MS4xfLAKM6DiCTYSPgCjoUVJ23B9MaW+CvthJ2W2Ywc3MG8UUAuqckpCSCuwFOORWyV2/cD+oZgKsIJyqm0Hge1GAF7I7l+xu5nKTeuXvQ7fskDA/ZDjP36+ WFZSjAQOZVLsDI+Vy3981gJr8VDxnW3mKnWwy+ZsiuVkTtNbyzur6etBApeMuHYZquyMId8ZJ3K/knjW7k+T8vV288UN6EXV6S5zE91JA9e00XPgK06H1a6f VfKd4AKA85XIpnuYUNegGfLnpIJXfNoX0lYu/01sIasp5BBck658HSCq1sUsab8BbXFOoIKvSWGrB6ikvm92Ux0bH/UvBuw8Qqq4Y4FN6aBkWoJ0fmm2GNGU k+MJa5l9 X-CM-Analysis: v=2.4 cv=AuWNYMxP c=1 sm=1 tr=0 ts=6425fa52 a=ZvkN53RyrFzj2rA+7ad7AA==:117 a=ZvkN53RyrFzj2rA+7ad7AA==:17 a=IkcTkHD0fZMA:10 a=NEAV23lmAAAA:8 a=b4LDLZbEAAAA:8 a=3_uRt0xjAAAA:8 a=FBHGMhGWAAAA:8 a=Cz_vMqFsv6YSnHZilyEA:9 a=QEXdDO2ut3YA:10 a=HCbV_Okekb0A:10 a=nTAoaPaEWFsA:10 a=20T61YgZp4ItGotXEy2O:22 a=z1SuboXgGPGzQ8_2mWib:22 a=9gvnlMMaQFpL9xblJ6ne:22 Received: from [192.168.2.49] (174.95.58.126) by cmx-mtlrgo001.bell.net (5.8.814) (authenticated as dave.anglin@bell.net) id 642328290045CC57; Thu, 30 Mar 2023 17:08:34 -0400 Message-ID: Date: Thu, 30 Mar 2023 17:08:34 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [committed] hppa: Drop 16-byte pthread lock alignment Content-Language: en-US To: Florian Weimer Cc: Sam James , John David Anglin , deller@gmx.de, libc-alpha@sourceware.org References: <87sfdrvxry.fsf@mid.deneb.enyo.de> <87zg7zc9km.fsf@gentoo.org> <20cc14ed-d49d-d655-b866-f8f9bb49e0eb@bell.net> <87ilemwek0.fsf@mid.deneb.enyo.de> From: John David Anglin In-Reply-To: <87ilemwek0.fsf@mid.deneb.enyo.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,NICE_REPLY_A,SPF_HELO_PASS,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: On 2023-03-27 8:42 a.m., Florian Weimer wrote: >> Here is comment in map.h: >>   // MapAllocator does not support alignments beyond 8. Technically we should >>   // support up to std::max_align_t, but this fails with ubsan and tcmalloc >>   // debug allocation logic which assume 8 as default alignment. >>   static_assert(alignof(value_type) <= 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.  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.  This includes protobuf.  As a result, the over alignment of pthread types will cause inconsistencies between different versions of c++ and c on hppa. After discussion, the consensus was to remove the over alignment. > > 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.  The current pthread types do not need 16-byte alignment. Dave -- John David Anglin dave.anglin@bell.net