[llvm] Reduce llvm-gsymutil memory usage (lambda-free, and less locking) (PR #97640)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 12 10:43:14 PDT 2024
dwblaikie wrote:
> > we centralized it in the ThreadSafeDWARFContext to avoid complicating other parts of libDebugInfoDWARF with thread safety concerns -> I wonder if this new concern can be factored into that existing design for the same reasons, so that thread safety concerns are relatively isolated/centralized
>
> Got it! I stumbled across this stuff last night. It still triggers my threading anti-pattern eye-twitch, but the system is designed on top of that, so 🤷. I'll refactor/hoist the gsym usage out to use this interface instead.
Yeah, none of this is gospel, FWIW - this was just our best guess at the time given that in general the libDebugInfoDWARF APIs suffer from a lot of inter-dependent interactions and a fairly wide API and so there's no doubt lots of uses that continue to be thread unsafe, so I partly didn't want us to try to guarantee general thread safety when it'd be so impractical given the design.
At some point it'd probably be worth reconsidering the whole design/throw it out and see what starting again looks like - though, equally, at some point, it'd be nice to merge most of these APIs with the LLDB versions (long ago the LLVM one was created as a fork of the LLDB one, and they've since diverged, contain a lot of duplication, etc). Not sure if it makes sense to do a major/invasive rewrite at the /same/ time as merging, or if they should be kept separate.
I guess LLDB would probably enjoy some of the benefits of parallelism in parsing DWARF (maybe - mostly it does it so lazily that there's little to parallelize at any one point in time - except when the input doesn't have an index, in which case it parses it all/indexes up front, but that's not the main case)
https://github.com/llvm/llvm-project/pull/97640
More information about the llvm-commits
mailing list