From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22351 invoked by alias); 18 Jul 2018 03:34:05 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 22337 invoked by uid 89); 18 Jul 2018 03:34:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=reappear, objfiles, shareable X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Jul 2018 03:34:03 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 498FC1E059; Tue, 17 Jul 2018 23:34:01 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=simark.ca; s=mail; t=1531884841; bh=lsVxLmSZW4z34LGzcZrlt+1ynwAWz2KziMpGtqfHYGE=; h=Subject:To:References:From:Date:In-Reply-To:From; b=B4knN/8PsMQOu1HccLx4Fb4RwUBQlBOIH+lnoGax96wIUKr7mHWXXsUM1upkd/8pQ Bm3Gi6mCjwoHIK10Rr74d31ShEUxzXY8deAUjTYrntlclZ3Azr4OVXArs/rELDrUD/ VN4eb4/dDahpCpxDPbWCqLTdWopKbs/WnBbtDdPg= Subject: Re: [RFA 08/15] Remove readin and compunit_symtab fields from psymtab To: Tom Tromey , gdb-patches@sourceware.org References: <20180510222357.27332-1-tom@tromey.com> <20180510222357.27332-9-tom@tromey.com> From: Simon Marchi Message-ID: <5f8f38c4-8b4b-9fea-b9f2-7c69758a09c2@simark.ca> Date: Wed, 18 Jul 2018 03:34:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180510222357.27332-9-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-07/txt/msg00540.txt.bz2 On 2018-05-10 06:23 PM, Tom Tromey wrote: > In order to move psymtabs off of the objfile obstack, there must be no > backlinks from the psymtab (or associated objects) to anything > allocated on the objfile obstack. > > This patch removes the readin and compunit_symtab fields from psymtab > to help achieve this goal, replacing them with per-objfile maps > indicating which psymtabs have been read in. This split will allow > for psymtab reuse across objfiles in the future. This LGTM, but I have two question. In the future, is the intent to also make symtabs (compunit_symtab) independent from program spaces, and shareable across objfiles, or would that not be possible? If it is possible, would the compunit_symtab pointer in psymtab re-appear, since there would now again be a single compunit_symtab for each psymtab? As Pedro pointed out a few times, unordered_map is an hash map with open hashing. So we change what was previously a single pointer dereference to a lookup in a hash table, followed with a linear search in a linked list. If this map is looked up very frequently, maybe we should consider using an htab_t instead? Some profiling data would help, but it seems like psymtab_read_in_p is called quite a bit when looking up symbols... Simon