Skip to content

RFC Combining CUs into a single hash table

Bill Wendling bpf dwarves 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest1 patch 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1dwarf_loader: have all CUs use a single hash tabledwarf_loader.c+33 -120 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/1] Combining CUs into a single hash table

Hey gang,

I would like your feedback on this patch.

This patch creates one hash table that all CUs share. The impetus for this patch is to support clang's LTO (Link-Time Optimizations). Currently, pahole can't handle the DWARF data that clang produces, because the CUs may refer to tags in other CUs (all of the code having been squozen together).

One solution I found is to process the CUs in two steps:

1. add the CUs into a single hash table, and
2. perform the recoding and finalization steps in a a separate step.

The issue I'm facing with this patch is that it balloons the runtime from ~11.11s to ~14.27s. It looks like the underlying cause is that some (but not all) hash buckets have thousands of entries each. I've bumped up the HASHTAGS__BITS from 15 to 16, which helped a little. Bumping it up to 17 or above causes a failure.

A couple of things I thought of may help. We could increase the number of buckets, which would help with distribution. As I mentioned though, that seemed to cause a failure. Another option is to store the bucket entries in a non-list, e.g. binary search tree.

I wanted to get your opinions before I trod down one of these roads.

Share and enjoy!
-bw

Bill Wendling (1):
dwarf_loader: have all CUs use a single hash table

 dwarf_loader.c | 45 +++++++++++++++++++++++++++++++++------------
 1 file changed, 33 insertions(+), 12 deletions(-)
Signature · 1 line
2.30.0.478.g8a0d178c01-goog