From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 1850B3858C53 for ; Sun, 17 Jul 2022 13:15:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1850B3858C53 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 4800B1FD3C; Sun, 17 Jul 2022 13:15:36 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 339C613A83; Sun, 17 Jul 2022 13:15:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id mz1mC3gL1GKVSQAAMHmgww (envelope-from ); Sun, 17 Jul 2022 13:15:36 +0000 Message-ID: <4225064d-73d9-52bd-fc21-341e787af40b@suse.de> Date: Sun, 17 Jul 2022 15:15:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [committed][gdb/symtab] Make per_cu->unit_type atomic Content-Language: en-US To: Tom Tromey , Tom de Vries via Gdb-patches References: <20220714061940.GA575@delia.home> <874jzht55r.fsf@tromey.com> From: Tom de Vries In-Reply-To: <874jzht55r.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2022 13:15:38 -0000 On 7/16/22 18:04, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries via Gdb-patches writes: > > Tom> - packed m_unit_type = (dwarf_unit_type) 0; > Tom> + std::atomic> m_unit_type {(dwarf_unit_type)0}; > > I was thinking about this patch this morning and I wonder if packed<> is > even needed now that the member is atomic. With packed: ... std::atomic> m_unit_type {(dwarf_unit_type)0}; ... we have: ... /* size: 120, cachelines: 2, members: 22 */ ... and without: ... std::atomic m_unit_type {(dwarf_unit_type)0}; ... we have: ... /* size: 128, cachelines: 2, members: 22 */ ... So it's necessary to keep the struct small. Thanks, - Tom