From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BEECB385828D; Fri, 22 Jul 2022 20:46:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BEECB385828D From: "tromey at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug symtab/29391] [gdb/symtab] Parallelize process_queue Date: Fri, 22 Jul 2022 20:46:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: tromey at sourceware dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2022 20:46:20 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D29391 --- Comment #1 from Tom Tromey --- It's an interesting idea but as you found there are some issues. The main issue behind a lot of the allocation problems is that gdb has a few per-objfile data structures that can't easily be used from multiple threads: the obstack but also the bcache and the demangled hash table. Maybe these problems could all be solved by sharding, or maybe by heap allocation. Also I think a couple patches in the series introduce locks where something like compare-and-swap would work just as well. However, I tend to think there's a better approach overall. The way I see it, there are two main issues with CU expansion. One is that sometimes gdb decides to expand too many CUs in response to a request. This is maybe covered by one of the=20 dependencies of bug #29366. I am not sure yet (haven't looked in detail) but I suspect the fix will be something like short-circuiting expansion for certain kinds of queries. Like, if gdb is looking for a type, just expand the first CU that matches. The second problem is that CU expansion can be slow. Here I think gdb could do a lot better, the basic idea being lazy CU expansion. In response to a CU expansion request, the DWARF reader would create the symtab / compunit_symtab structures and it would also create some "outline" struct symbols -- one for each cooked_index_entry. Then when some attribute of a symbol is needed (say, the type), the DWARF reader would read the rest of the symbol that that moment. The major advantage of this approach is that most data in a CU is not needed at all. So, much less work would need to be done in general. I think it would be possible to avoid reading every DIE. A secondary advantage is that, because the symbols are created directly from the cooked index, we would avoid the situation where the two readers could diverge. That would no longer be possible at all. There are some downsides. It's more complex, and it is complicated to implement and test. Also I think it would require fixing the .debug_names bug, and also probably removing .gdb_index support. Finally, we'd have to change the blockvector to be expandable. --=20 You are receiving this mail because: You are on the CC list for the bug.=