Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Yubin <ablacktshirt@gmail.com>
Cc: Luis Machado <luis.machado@arm.com>,
	 gdb@sourceware.org,  Tom Tromey <tom@tromey.com>
Subject: Re: parallel loading of debug info in gdb
Date: Tue, 07 Jan 2025 16:45:13 -0700	[thread overview]
Message-ID: <87frluw5me.fsf@tromey.com> (raw)
In-Reply-To: <CAJYFCiOV1POiKnomUZOw7-SX6RqMvVeJ2f7A-L=R5EmKEukOPg@mail.gmail.com> (Yubin's message of "Tue, 7 Jan 2025 19:33:13 +0800")

> Yes dependency is a problem, but some dependent libs are naturally
> independent to be read by parallel. If there could be some way to
> specify this, it would be great.

If you try git gdb, you can enable background reading with
"maint set dwarf synchronous off".

(There's been at least one request to re-enable this by default for GDB
16... I wasn't sure if we should, though, considering that the data race
fixes are pretty new.)

Anyway, background reading is lazier -- the reading is started but gdb
will only pause for it if it is truly needed.

Note that the library debug info isn't really read in parallel.  Or, it
kind of is, depending on how the scheduling shakes out.  That is, the
DWARF reader looks at the number of worker threads and splits its work
up accordingly.  "Overlap" can only really happen if one such worker
finishes and then the next library's job is scheduled.

This might be a bad strategy overall.  Like, testing on a big machine
showed that the reader didn't parallelize past 8 CPUs, so maybe it would
be better to limit the DWARF reader to 8 tasks.  Nobody has worked on
figuring out why it doesn't scale better, though, and I wouldn't want to
change this without knowing more.

Tom

  reply	other threads:[~2025-01-07 23:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-07  2:14 Yubin via Gdb
2025-01-07 11:07 ` Luis Machado via Gdb
2025-01-07 11:33   ` Yubin via Gdb
2025-01-07 23:45     ` Tom Tromey [this message]
2025-01-08 15:40       ` Yubin via Gdb
2025-01-09  0:26         ` 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=87frluw5me.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=ablacktshirt@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=luis.machado@arm.com \
    /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