Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Simon Marchi <simark@simark.ca>
Cc: Tom Tromey <tom@tromey.com>,  gdb-patches@sourceware.org
Subject: Re: [RFA 08/15] Remove readin and compunit_symtab fields from psymtab
Date: Wed, 18 Jul 2018 18:56:00 -0000	[thread overview]
Message-ID: <8736wg5q6b.fsf@tromey.com> (raw)
In-Reply-To: <5f8f38c4-8b4b-9fea-b9f2-7c69758a09c2@simark.ca> (Simon Marchi's	message of "Tue, 17 Jul 2018 23:34:00 -0400")

>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

>> 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.

Simon> This LGTM, but I have two question.  In the future, is the intent to also
Simon> make symtabs (compunit_symtab) independent from program spaces, and
Simon> shareable across objfiles, or would that not be possible?  If it is
Simon> possible, would the compunit_symtab pointer in psymtab re-appear, since
Simon> there would now again be a single compunit_symtab for each psymtab?

I think it is a good long-term goal, but not the only possible one in
this area.

The main downside is that it is hard to do.  There's a reasonably
complete to-do list here:

    https://sourceware.org/gdb/wiki/ObjfileSplitting

Some of these steps are tricky and/or laborious.

So, my thought with this second series was that perhaps gdb could get
most of the benefits of the split without the full implementation.

To my mind the performance issue is the major one to solve, with memory
use being second.  So, for instance, if gdb had this psymbol series,
plus maybe incremental expansion of partial symbol tables, perhaps that
would be enough.  This is based in my belief that psymtab reading is the
obvious spot where gdb spends its time, and that CU expansion is
generally fast (but with the occasional counterexample).

So maybe the full objfile splitting project will not even happen (and so
the backlink would never be restored).

Simon> As Pedro pointed out a few times, unordered_map is an hash map with open
Simon> hashing.  So we change what was previously a single pointer dereference
Simon> to a lookup in a hash table, followed with a linear search in a linked
Simon> list.  If this map is looked up very frequently, maybe we should consider
Simon> using an htab_t instead?  Some profiling data would help, but it seems
Simon> like psymtab_read_in_p is called quite a bit when looking up symbols...

I will look into it a bit.

Tom


  reply	other threads:[~2018-07-18 18:56 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10 22:25 [RFA 00/15] Work toward making psymtabs reusable Tom Tromey
2018-05-10 22:25 ` [RFA 14/15] Make psymtab_storage::free_psymtabs private Tom Tromey
2018-07-18 14:36   ` Simon Marchi
2018-09-23 21:13     ` Tom Tromey
2018-05-10 22:25 ` [RFA 08/15] Remove readin and compunit_symtab fields from psymtab Tom Tromey
2018-07-18  3:34   ` Simon Marchi
2018-07-18 18:56     ` Tom Tromey [this message]
2018-09-28  5:02     ` Tom Tromey
2018-10-06  1:24       ` Tom Tromey
2018-10-07 22:04         ` Simon Marchi
2018-10-08  0:01           ` Tom Tromey
2018-05-10 22:25 ` [RFA 11/15] Allocate the address map on the psymtab obstack Tom Tromey
2018-07-18 14:08   ` Simon Marchi
2018-05-10 22:25 ` [RFA 02/15] Remove some unneeded psymtab initializations Tom Tromey
2018-07-17 15:27   ` Simon Marchi
2018-07-18  2:29     ` Simon Marchi
2018-05-10 22:25 ` [RFA 06/15] Change create_demangled_names_hash to take an objfile_per_bfd_storage Tom Tromey
2018-07-18  2:52   ` Simon Marchi
2018-05-10 22:25 ` [RFA 01/15] Move some declarations to mdebugread.h Tom Tromey
2018-07-17 15:20   ` Simon Marchi
2018-05-10 22:25 ` [RFA 05/15] Simplify calls to init_psymbol_list Tom Tromey
2018-07-18  2:51   ` Simon Marchi
2018-09-23 21:12     ` Tom Tromey
2018-05-10 22:25 ` [RFA 04/15] Change add_psymbol_to_list to use an enum Tom Tromey
2018-07-18  2:41   ` Simon Marchi
2018-05-10 22:25 ` [RFA 03/15] Remove parameters from start_psymtab_common Tom Tromey
2018-07-17 15:41   ` Simon Marchi
2018-05-10 22:25 ` [RFA 10/15] Introduce objfile::reset_psymtabs Tom Tromey
2018-07-18 14:04   ` Simon Marchi
2018-05-10 22:25 ` [RFA 07/15] Change symbol_set_names to take an objfile_per_bfd_storage Tom Tromey
2018-05-10 22:25 ` [RFA 15/15] Move psymtabs to their own obstack Tom Tromey
2018-07-18 14:41   ` Simon Marchi
2018-09-23 21:34     ` Tom Tromey
2018-05-10 22:45 ` [RFA 09/15] Introduce class psymtab_storage Tom Tromey
2018-07-18 14:02   ` Simon Marchi
2018-05-11 10:53 ` [RFA 12/15] Move more allocations to psymtab obstack Tom Tromey
2018-07-18 14:24   ` Simon Marchi
2018-05-11 10:53 ` [RFA 13/15] Add psymtab_storage::allocate_dependencies Tom Tromey
2018-07-18 14:32   ` Simon Marchi
2018-09-23 21:25     ` Tom Tromey
2018-06-18 14:42 ` [RFA 00/15] Work toward making psymtabs reusable Tom Tromey
2018-07-16 16:33   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8736wg5q6b.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox